示例#1
0
文件: main.go 项目: nsf/torgo
func dispatch_command() {
	switch os.Args[1] {
	case "make":
		make.Tool()
	case "view":
		view.Tool()
	case "client":
		client.Tool()
	case "-h", "--help", "help":
		print_version()
		fmt.Print(main_help)
	case "-v", "--version", "version":
		print_version()
	default:
		fmt.Fprintf(os.Stderr, "unknown command: %s", os.Args[1])
		os.Exit(1)
	}
}
示例#2
0
文件: main.go 项目: nsf/torgo
func main() {
	if len(os.Args) == 1 {
		client.Tool()
	}
	dispatch_command()
}