Added option --no-hidraw for the case where hidraw=true is in a confi…#77
Open
poconbhui wants to merge 1 commit intochrippa:masterfrom
Open
Added option --no-hidraw for the case where hidraw=true is in a confi…#77poconbhui wants to merge 1 commit intochrippa:masterfrom
poconbhui wants to merge 1 commit intochrippa:masterfrom
Conversation
…g file but you want to turn it off on the command line.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added a --no-hidraw option to negate hidraw=true if it's set in a config file.
The way the argument parser is set up, it's impossible to tell if an argument has been set explicitly by a user or not. This made it a bit difficult to set hidraw back to false on the command line if it was set to true in a config file. Reparsing the command line into a supplied namespace seemed to do the trick.
This problem still exists in the controllers parsing.
I usually get around this problem by explicitly finding and setting defaults somewhere outside of the argument parser. Having a default setter class which has values and defaults added to it alongside the parser might be a way to go. Ideas?