Alternate approach for parsing/threading to subcommands #28
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
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#28
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
While fiddling with #25, I ran into an issue where
sub_app_rm
keeps getting selected instead ofsub_app_secret_rm
based on the(delete|rm)
argument which is determined by the logic in theabra
function. It's a bit magic in there.Following the https://github.com/andsens/docopt.sh docs I came up with the following approach for matching parsed CLI input against subcommand functions:
Then we manually iterate out all the matches ourselves. I like our one script approach and not having to manage multiple
DOC="..."
is a bonus for me. Having to write everything out ourselves is a bit gack but that seems to be the trade-off.Tried it over at:
Existing implementation fixed, onwards!