Add per-subcommand help using abra help <subcommand>
#61
Merged
3wordchant
merged 5 commits from 2021-01-01 12:13:29 +00:00
command_help_2 into main
Labels
Clear labels
CI/CD
breaking-change
bug
design
documentation
duplicate
enhancement
help wanted
invalid
plugin
question
secrets
shell-completion
versioning
wontfix
Anything to do with testing and infra
Anything that breaks the existing API
Something is not working
Anything to with UX of this tool
Documentation
This issue or pull request already exists
New feature
Need some help
Something is wrong
Related to the plugin architecture
More information is needed
Everything to do with docker secrets
To do with shell completion
All the things to do with versioning apps
This won't be fixed
No labels
Milestone
No items
No Milestone
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze (Born Deleuze)
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
dannygroenewegen (Danny Groenewegen)
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1 (p4u1)
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting (stevensting)
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra-bash#61
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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>...