It's very handy when a CLI prints help not only with --help flag, but also with help command. Let's add an option WithHelpCommands() which makes the following runs behaving the same:
my-bin foo bar --help
my-bin foo bar -h
my-bin foo bar help
my-bin --help foo bar
my-bin -h foo bar
my-bin help foo bar
Now, users have to manipulate args to achieve the desired:
for i, arg := range os.Args[1:] {
if arg == "help" {
os.Args[1+i] = "--help"
}
}
It's very handy when a CLI prints help not only with
--helpflag, but also withhelpcommand. Let's add an optionWithHelpCommands()which makes the following runs behaving the same:Now, users have to manipulate args to achieve the desired: