diff --git a/main.go b/main.go index 11ee132..192d419 100644 --- a/main.go +++ b/main.go @@ -16,13 +16,19 @@ import ( const binroot = "/town/commands" var rootCmd = &cobra.Command{ - Use: "town", - Short: "Run commands unique to tilde.town", + Use: "town", + Short: "Run commands unique to tilde.town", + DisableFlagParsing: true, +} + +func init() { + rootCmd.Flags().BoolP("help", "h", false, "") } var adminCmd = &cobra.Command{ - Use: "admin", - Short: "Run administrative commands", + Use: "admin", + Short: "Run administrative commands", + DisableFlagParsing: true, } func isAdmin() (bool, error) { @@ -134,6 +140,7 @@ func execWrapper(executablePath string) func(*cobra.Command, []string) error { } func cli() int { + rootCommand.PersistentFlags().BoolFlagP("help", "h", false) err := parseCommands(rootCmd, "core") if err != nil { fmt.Fprintf(os.Stderr, "failed to parse core commands: %s", err)