Repository navigation
Command line utils: allow 'inherited' options - #131
Merged
Merged
Conversation
| } | ||
|
|
||
| public CommandOption Option(string template, string description, CommandOptionType optionType) | ||
| public CommandOption Option(string template, string description, CommandOptionType optionType, bool inherited = false) |
There was a problem hiding this comment.
This is a breaking change (API/binary compatibility). Consider adding an overload
Author
|
🆙 📅 |
Author
|
Ping for review. (FYI I originally listed bricelam for sign off, but he's out on paternity leave now) |
| return Option(template, description, optionType, _ => { }); | ||
| } | ||
| => Option(template, description, optionType, _ => { }, inherited: false); | ||
| public CommandOption Option(string template, string description, CommandOptionType optionType, bool inherited) |
|
@moozzyk can you finish reviewing and sign off? |
|
|
||
| [Fact] | ||
| public void NestedOptionConflictThrows() | ||
| { |
There was a problem hiding this comment.
Can you have nested options with the same name if they are not inherited (i.e. --ask would overwrite --always)? Can you add a test for this?
Author
There was a problem hiding this comment.
Yes, when options are not inherited (default), only the subcommand-local options are searched. I'll add a sanity test for it.
|
🚢🇮🇹 |
natemcmaster
force-pushed
the
namc/inherited
branch
from
June 29, 2016 17:40
50e1a92 to
1380d8d
Compare
5 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some options apply to all subcommands. This makes improves usability so that inherited commands can be specified in any order