You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As pointed out by @jcelliott in #3, running the root command without any arguments, or running the root command with <command> help does not print the Command.Long description.[1] Given that the help command is the only venue in which you can see the Long description, this is a bug. (The README indicates that the Long description should be printed as well.)
The issue is that Command.Usage() doesn't print the Long description, only Command.Help() does. This would be fine if Command.Help() always printed Usage. But instead, Command.Help() only prints Usage if the Command is Runnable, which the root command typically is not. Instead, Command.Help() should print Usage if the command is Runnable OR if the command HasSubCommands.
When Help() is fixed to print Usage in those cases, Help is often the preferred thing to print, not Usage.
I am submitting a PR which fixes the Help() behavior and changes a few Usage() references to use Help() instead.
[1] As an aside, if you go get the latest cobra release, this behavior is visible on Hugo right now.
The text was updated successfully, but these errors were encountered:
ghodss
pushed a commit
to ghodss/cobra
that referenced
this issue
Sep 3, 2014
As pointed out by @jcelliott in #3, running the root command without any arguments, or running the root command with
<command> help
does not print the Command.Long description.[1] Given that the help command is the only venue in which you can see the Long description, this is a bug. (The README indicates that the Long description should be printed as well.)The issue is that Command.Usage() doesn't print the Long description, only Command.Help() does. This would be fine if Command.Help() always printed Usage. But instead, Command.Help() only prints Usage if the Command is Runnable, which the root command typically is not. Instead, Command.Help() should print Usage if the command is Runnable OR if the command HasSubCommands.
When Help() is fixed to print Usage in those cases, Help is often the preferred thing to print, not Usage.
I am submitting a PR which fixes the Help() behavior and changes a few Usage() references to use Help() instead.
[1] As an aside, if you
go get
the latest cobra release, this behavior is visible on Hugo right now.The text was updated successfully, but these errors were encountered: