-
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
Open
marquiz
wants to merge
6
commits into
agx:master
Choose a base branch
from
marquiz:feature/argparse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/argparse #42
Conversation
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
marquiz
force-pushed
the
feature/argparse
branch
2 times, most recently
from
January 15, 2018 11:27
56fc461
to
422f929
Compare
marquiz
force-pushed
the
feature/argparse
branch
from
January 18, 2018 09:07
422f929
to
1f17906
Compare
marquiz
force-pushed
the
feature/argparse
branch
2 times, most recently
from
March 1, 2018 13:39
ea4813e
to
e8ff551
Compare
ping @agx: any thoughts or comments on this? |
marquiz
force-pushed
the
feature/argparse
branch
2 times, most recently
from
September 14, 2018 10:41
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>
marquiz
force-pushed
the
feature/argparse
branch
from
September 17, 2018 11:40
5e94679
to
37147bf
Compare
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.