Add per-subcommand help using abra help <subcommand>
#61
Reference in New Issue
Block a user
No description provided.
Delete Branch "command_help_2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #50
Didn't wanna get too far into defining help because it's going to require some fun editing once #60 lands, but I hope the concept with
help_app_lsetc. is clear.Try running
abra help foobarand you'll get a list of available per-command help.versionsubcommand 55a406573b#60 bomb dropped!
Never seen
help <cmd>_<sub-cmd>style help so feeling a bit put off by that but I don't want to drown you in my subjectivities again ;) Any way to get this sort of help popping out for-h/--help? Looking good though! This will really bring polish to the CLI.Thanks for the review!
Mm it's not ideal..
.. and yeah that would be best, 💯
I got stuck on
docoptrecognising commands: four ways I could think of doing that, all of which seemed mega-hairy:docoptdefinition, e.g.git/dockerdocoptlinesdocoptentries clobbering each other? Not sure how reliably it'll distinguishabra app cp --helpfromabra app <domain> --helpcommand_help_1with the existing[options]defabra app cp --help→ generic usage message,abra app foo_bar_com cp --help→ generic usage message,abra app foo_bar_com cp src --help→ generic usage message, onlyabra app foo_bar_com cp src dst→ help forapp cp--helparg to show a usage message just for that command.gitanddocker, although NB Docker is fussy about where--helpis applied:(
gitis a little fussy but not as bad,git branch -a --helpwill fail if you're not in a git repo whereasgit branch --helpworks everywhere)and then:
docopthelpis consistent with the actual commandabra app:deploy foo_bar_comfollowed byabra app:logs foo_bar_comrequires lots of keystrokes or advanced Bash-fu (!!:gs/deploy/logsor^deploy^logs)Any preferences between these?
Thanks for this epic review of the options.
What I like about our solution is that it is quite constrained by the wonders of Bash and Docopt and this feels like we're going against the grain here.
Should we just figure out how to write a man page so we can
man abraand add a one-liner in the docopt definition that you can runman abrafor more?Potentials:
Yeah I was having the same thought, how much docopt-torturing is too much 😬
Long as my review was, I missed an obvious option tho:
abra [options] help <subcommand>...then:
abra help app lsThen we just combine
$abra__subcommand_options with underscores and we can even re-use my existing dubioushelp_app_lsconvention.Whaddya reck?
7ec625e329to5411c85793🌈
abra [options] help <subcommand>...