func main() { if len(os.Args) < 2 { fmt.Fprintln(os.Stderr, "specify a command please") fmt.Fprintln(os.Stderr, "Commands:") fmt.Fprintf(os.Stderr, " %v\n", someutils.List()) os.Exit(1) } err := someutils.Call(os.Args[1], os.Args[1:]) if err != nil { fmt.Printf("Error: %v\n", err) os.Exit(1) } }
func showHelp(msg string) { fmt.Fprintln(os.Stderr, "`some`") fmt.Fprintln(os.Stderr, msg) fmt.Fprintln(os.Stderr, " Available commands:") fmt.Fprintf(os.Stderr, " %v\n", someutils.List()) }
func showHelp() { fmt.Fprintln(os.Stderr, "`someutils`") fmt.Fprintln(os.Stderr, " No command specified.") fmt.Fprintln(os.Stderr, " Available commands:") fmt.Fprintf(os.Stderr, " %v\n", someutils.List()) }
func showHelp() { fmt.Fprintln(os.Stderr, "specify a command please") fmt.Fprintln(os.Stderr, "Commands:") fmt.Fprintf(os.Stderr, " %v\n", someutils.List()) }