Skip to content

Instantly share code, notes, and snippets.

@JasonQSY
Created January 19, 2017 08:53
Show Gist options
  • Save JasonQSY/d2b90d6b5a225c9bb8f95311eaa46272 to your computer and use it in GitHub Desktop.
Save JasonQSY/d2b90d6b5a225c9bb8f95311eaa46272 to your computer and use it in GitHub Desktop.
/**
* xm program. written by go.
*
* @build go build xm.go
* @example ./xm --> Output: xm
* @example ./xm gg --> Output: xmgg
* @example ./xm [all|-all|--all]
*/
package main
import (
"fmt"
"os"
)
func main() {
// no cl args
if len(os.Args) == 1 {
fmt.Println("xm")
return;
}
// has cl args
obj := os.Args[1]
if obj == "--all" || obj == "-all" || obj == "all" {
fmt.Println("xmht")
fmt.Println("xmgg")
fmt.Println("xgxd")
} else {
fmt.Println("xm" + obj)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment