Skip to content
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
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Feature/argparse #42

wants to merge 6 commits into from

Commits on Sep 17, 2018

  1. 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]>
    marquiz committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    b3a5ba1 View commit details
    Browse the repository at this point in the history
  2. 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]>
    marquiz committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    3a6db9b View commit details
    Browse the repository at this point in the history
  3. 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]>
    marquiz committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    c55b5dc View commit details
    Browse the repository at this point in the history
  4. pq: use argparse subparsers

    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]>
    marquiz committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    6fa93b3 View commit details
    Browse the repository at this point in the history
  5. 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]>
    marquiz committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    30ebb97 View commit details
    Browse the repository at this point in the history
  6. 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]>
    marquiz committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    37147bf View commit details
    Browse the repository at this point in the history