cli icon indicating copy to clipboard operation
cli copied to clipboard

Allow same flag to be repeated by child commands.

Open ipostelnik opened this issue 3 years ago • 4 comments

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.


ipostelnik avatar Feb 12 '21 16:02 ipostelnik

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.

stale[bot] avatar Jul 01 '21 18:07 stale[bot]

Closing this as it has become stale.

stale[bot] avatar Jul 31 '21 21:07 stale[bot]

@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?

meatballhat avatar Apr 19 '22 23:04 meatballhat

It has been a while, I will try to rebase this PR on current master and look into comments.

ipostelnik avatar Apr 20 '22 17:04 ipostelnik

@ipostelnik I've rebased your PR on latest

dearchap avatar Oct 25 '22 14:10 dearchap

I am inclined to close this since we have merged persistent flag support in 3.x

dearchap avatar Nov 28 '22 00:11 dearchap