spf13/cobra — pull request #32 by smarterclayton (2014-11-12 04:46:33+00:00)
Title: When no subcommands are registered, omit command help output

For a single root command with a Run method, the help output still
contains 'help [command]' as a subcommand (because Help is always
added). Since the only subcommand would be 'help', the help is better
off omitted.

This change allows a command to be used both as a subcommand
or a root command without having to define a custom help that elides
the help command when no subcommands are added. Instead, the default
help command is only added when subcommands are present.

Example:

$ mycommand --help
longdescription

Usage:
mycommand

Available Flags:
--help=false
....

# no help message displayed at end

If you specify a custom help command, your help command will be used
regardless of subcommand presence.