cli
cli copied to clipboard
Allow same flag to be repeated by child commands.
Reading the value or checking for presence looks at the most specific subcommand that includes the flag on the command line.
What type of PR is this?
- feature
What this PR does / why we need it:
Add support for duplicate flags along subcommand chain. This allows the application and (sub)commands to define the same flag. The context for the ultimate action that runs will read the most specific value.
Which issue(s) this PR fixes:
Testing
Added a number of units tests to cover these cases. Corrected some of the existing tests to correctly mock operation of the production code.
Release Notes
(sub)commands can now re-declare flags defined at parent command or the app. This allows these flags to appear in either location on the command-line. During action execution, context will read value provided at most-specific (rightmost) position.
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.
Closing this as it has become stale.
@ipostelnik Hello and sorry for the delay and auto-close via stalebot. Are you up for revisiting this work, resolving conflicts, and incorporating changes from feedback?
It has been a while, I will try to rebase this PR on current master and look into comments.
@ipostelnik I've rebased your PR on latest
I am inclined to close this since we have merged persistent flag support in 3.x