-
Notifications
You must be signed in to change notification settings - Fork 67
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
Feature/argparse #42
base: master
Are you sure you want to change the base?
Feature/argparse #42
Commits on Sep 17, 2018
-
config: convert to using argparse
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b3a5ba1 - Browse repository at this point
Copy the full SHA b3a5ba1View commit details -
config: allow adding config file arg without help
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3a6db9b - Browse repository at this point
Copy the full SHA 3a6db9bView commit details -
GbpConfArgParser.get_conf_file_value: only allow valid options
Raise an exception if the queried option is not in the list of valid config file args. Signed-off-by: Markus Lehtonen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c55b5dc - Browse repository at this point
Copy the full SHA c55b5dcView commit details -
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6fa93b3 - Browse repository at this point
Copy the full SHA 6fa93b3View commit details -
scripts: drop redundant argparser 'default' args
There is no need to provide a default when 'store_true' or 'store_false' action is used. Signed-off-by: Markus Lehtonen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 30ebb97 - Browse repository at this point
Copy the full SHA 30ebb97View commit details -
scripts: drop redundant argparser 'dest' args
These are the defaults automatically provided by argparse. This hopefully slightly improves readability of the code. Signed-off-by: Markus Lehtonen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 37147bf - Browse repository at this point
Copy the full SHA 37147bfView commit details