Skip to content

Commit

Permalink
fix: verbose help flag
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan committed Jan 5, 2022
1 parent 9c63cae commit 44984e1
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions bin/vproxy/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ func parseFlags() {
Aliases: []string{"V"},
Usage: "Print the version",
}
cli.HelpFlag = &cli.BoolFlag{
Name: "help",
Aliases: []string{"h"},
Usage: "Show help (add -v to show all)",
}

hideFlags := shouldHideFlags()

Expand Down Expand Up @@ -256,6 +251,28 @@ or add a file to your bash_completion.d:
vproxy bash_completion > /etc/bash_completion.d/vproxy
`,
},
{
Name: "help",
Aliases: []string{"h"},
Usage: "Shows a list of commands (add -v to show all) or help for one command",
Hidden: false,
ArgsUsage: "[command]",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "verbose",
Aliases: []string{"v"},
Usage: "Show all commands",
},
},
Action: func(c *cli.Context) error {
args := c.Args()
if args.Present() {
return cli.ShowCommandHelp(c, args.First())
}
_ = cli.ShowAppHelp(c)
return nil
},
},
{
Name: "version",
Usage: "Print the version",
Expand Down

0 comments on commit 44984e1

Please sign in to comment.