Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track parent command's attributes with local override #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

djerius
Copy link
Contributor

@djerius djerius commented Jan 14, 2019

(This is based off of my subcommand branch, as it requires access to the parent command.)

This commit provides the ability for a sub-command to track the value of a parent's option and override it locally. For example, if the app has a verbose option, and the sub-command also has a verbose option with the inherit attribute set,

mycmd.pl --verbose=3  subcommand

results in subcommand's verbose option equal to 3 while

mycmd.pl --verbose=3  subcommand --verbose=20

sets subcommand's verbose option to 20.

There's no documentation yet; the classes in t/inherit.t illustrate the concept.

It can easily be updated to incorporate a future metadata API.

@djerius
Copy link
Contributor Author

djerius commented Jan 15, 2019

Turns out I was wrong about what was needed for this. This is now based solely off of master.

…n up code

* creating the inherited option value generator as a builder provides
  an actual name for the method, which allows it to be overloaded

* the factory for the builder method is now in its own routine rather than
  in the midst of other code

* the code has been reformatted to hopefully match that of the project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant