WIP: start on passing through help when appropriate
parent
2ae5135f3a
commit
0353e2d704
15
main.go
15
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)
|
||||
|
|
Reference in New Issue