Add per-subcommand help using abra help <subcommand>
#61
No reviewers
Labels
No Label
breaking-change
bug
CI/CD
design
documentation
duplicate
enhancement
help wanted
invalid
plugin
question
secrets
shell-completion
versioning
wontfix
No Milestone
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#61
Loading…
Reference in New Issue
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_ls
etc. is clear.Try running
abra help foobar
and you'll get a list of available per-command help.#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
docopt
recognising commands: four ways I could think of doing that, all of which seemed mega-hairy:docopt
definition, e.g.git
/docker
docopt
linesdocopt
entries clobbering each other? Not sure how reliably it'll distinguishabra app cp --help
fromabra app <domain> --help
command_help_1
with 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
--help
arg to show a usage message just for that command.git
anddocker
, although NB Docker is fussy about where--help
is applied:(
git
is a little fussy but not as bad,git branch -a --help
will fail if you're not in a git repo whereasgit branch --help
works everywhere)and then:
docopt
help
is consistent with the actual commandabra app:deploy foo_bar_com
followed byabra app:logs foo_bar_com
requires lots of keystrokes or advanced Bash-fu (!!:gs/deploy/logs
or^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 abra
and add a one-liner in the docopt definition that you can runman abra
for 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 ls
Then we just combine
$abra__subcommand_
options with underscores and we can even re-use my existing dubioushelp_app_ls
convention.Whaddya reck?
7ec625e329
to5411c85793
🌈
abra [options] help <subcommand>...