Open
Conversation
56fc461 to
422f929
Compare
422f929 to
1f17906
Compare
ea4813e to
e8ff551
Compare
Contributor
Author
|
ping @agx: any thoughts or comments on this? |
1efcedf to
5e94679
Compare
Utilize the newer and more flexible argparse module instead of optparse. Configuration file loading is handled in a separate class. This patch implements a gbp-specific argparser class for handling prefix and using the config as default values. The parser is actually a wrapper class around argument parser and argument groups in order to avoid inheriting private classes of the argparse module. All gbp commands are changed to use the newly added gbp-specific argparser. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Previously, adding a config file arg with no help resulted in KeyError if no default help text was defined. Now, it is possible to add a config arg without a help text. This makes the argument parser more consistent as adding "non-conf-file-args" requires no help text, either. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Raise an exception if the queried option is not in the list of valid config file args. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Rework pq and pq-rpm commands to utilize the subparsers (or subcommands) functionality of Python argparse. This changes the calling convention slightly: now the action (export, import, ...) must be the first argument - all other cmdline arguments/options must be given after that. E.g. it is not possible to do 'gbp pq -v export' anymore, but, one must use 'gbp pq export -v'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
There is no need to provide a default when 'store_true' or 'store_false' action is used. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
These are the defaults automatically provided by argparse. This hopefully slightly improves readability of the code. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
5e94679 to
37147bf
Compare
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.
No description provided.