hanami: --help options does not work correctly for some subcommands
hanami new --help, instead of describing available options, prints
ERROR: "hanami new" was called with no arguments
Usage: "hanami new APPLICATION_NAME"
This discovery made me try the --help option for all other subcommands (at least those listed by hanami help). This way I found a bug
hanami db --helphanami destroy --helphanami generate --help
All these commands print
Usage:
hanami help [COMMAND]
Describe subcommands or one specific subcommand
which is help for hanami help, not for the respective subcommands.
(ADDED LATER)
Help for sub-subcommands prints misleading usage synopsis: e.g. hanami db create --help prints
Usage:
hanami create
instead of expected
Usage:
hanami db create
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (12 by maintainers)
My experience with Thor (the library that we use for CLI) is that isn’t good enough for subcommands.
The current implementation of our commands
lib/hanami/commandsis messy. I’m planning a rewrite after 1.0.I hope so, but I don’t know when exactly. Anyone knowing how to fix it or willing to dig into it is most welcome to take it over.
@charlie-wasp thank you !! @jodosha, I am tackling on this and will open a PR asap. Thanks !
Is help still wanted? I’d like to give it a try
@jodosha I think we should get rid of Thor and use OptionParser from Ruby standard library 😉