-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Make UnrecognizedArgumentHandling per command scope #371
Merged
natemcmaster
merged 7 commits into
natemcmaster:main
from
scott-xu:UnrecognizedArgumentHandling_SubCommand
Aug 28, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6f7a7bd
reproduce https://github.com/natemcmaster/CommandLineUtils/issues/370
scott-xu 3cce7b0
reproduce https://github.com/natemcmaster/CommandLineUtils/issues/370
scott-xu 9d84801
UseDefaultConventions
scott-xu 423b9fc
remove extra line
scott-xu e0594df
Use subcommand with CommandAttribute
scott-xu 7343497
Fix https://github.com/natemcmaster/CommandLineUtils/issues/370
scott-xu 24f9dfd
AllowSettingOptionNameValueSeparatorsPerCommand
scott-xu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, is there any point to keeping the ParserConfig class?
It seems this is sort of going the opposite direction I was hoping to go in #298. I was hoping to extract the parsing behavior of CommandLineApplication into a separate class completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to make the parser config per command, we have to associate them. If we want to inherit the config from parent command, we can’t do it inside ParserConfig as it has no info of its parent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably a bigger refactor than we need right now.
With this PR as is right now, does the
ParserConfig
class do anything? Or can it be deleted?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ParserConfig
is still needed. It is a property ofCommandLineApplication
. It tells theCommandLineApplication
that each config is set or not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure we can move the two properties of
ParserConfig
toCommandLineApplication
as private fields and then deleteParserConfig
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that you want to avoid "big class". However, the
UnrecognizedArgumentHandling
andOptionNameValueSeparators
are already published API aboutCommandLineApplication
. It will be a breaking change if we remove it fromCommandLineApplication
.As I said in #370 (comment), this PR has no open API change.