Open
Description
I'm building a CLI using Thor::Group to register commands and noticed that cli help command
is not nearly as helpful as cli command --help
. The longer description printed by using cli command --help
shows the Thor::Group command's options, but cli help command
does not. Also, cli command --help
gives a weird (and wrong) command name. Lastly, the desc
is only printed when running cli help command
and not when running cli command --help
(unless I duplicate the desc in the Thor::Group class itself)
My example code is at https://github.com/davidcelis/creperie where I'm building a CLI a la Rails has to create new Crepe applications. You can reproduce my example below:
$ git clone [email protected]:davidcelis/creperie.git
$ cd creperie
$ gem build creperie.gemspec
$ gem install creperie-0.0.1.pre.gem
$ crepe help new
Usage:
crepe new [APP_NAME]
Create a new Crepe application.
$ crepe new --help
Usage:
crepe creperie:generators:app APP_NAME
Options:
-B, [--skip-bundle] # Don't run bundle install
-G, [--skip-git] # Don't create a git repository
-h, [--help] # Print this usage information and exit
Runtime options:
-f, [--force] # Overwrite files that already exist
-p, [--pretend] # Run but do not make any changes
-q, [--quiet] # Suppress status output
-s, [--skip] # Skip files that already exist
Create a new Crepe application.
$ crepe creperie:generators:app
Could not find command "creperie:generators:app"
So, in summary:
crepe help new
prints very basic USAGE instructions despite being the help path given to userscrepe new --help
prints the desired USAGE instructions but is not discoverable- Related, if
class_option :help
isn't provided,--help
(although clearly available as an option) is not listed under the Options banner despite it seemingly being available by default all the time.
- Related, if
crepe new --help
prints the wrong command name- If
desc
is not duplicated inside of the Thor::Group class, the "Say hello!" description is only printed incli help COMMAND
and notcli COMMAND --help
Metadata
Metadata
Assignees
Labels
No labels