pkgdev.cli module

Various command-line specific support.

class pkgdev.cli.ArgumentParser(parents=(), **kwargs)[source]

Bases: ArgumentParser

Parse all known arguments, from command line and config file.

parse_known_args(args=None, namespace=None)[source]

Add support for running registered pre-parse functions.

class pkgdev.cli.ConfigArg(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: _StoreAction

Store config path string or False when explicitly disabled.

class pkgdev.cli.ConfigFileParser(parser: ArgumentParser, configs=(), **kwargs)[source]

Bases: object

Argument parser that supports loading settings from specified config files.

config
default_configs = ('/etc/pkgdev/pkgdev.conf', '/home/runner/.config/pkgdev/pkgdev.conf')
parse_config(configs=())[source]

Parse given config files.

parse_config_options(namespace, configs=())[source]

Parse options from config if they exist.

parse_config_sections(namespace, sections)[source]

Parse options from a given iterable of config section names.

class pkgdev.cli.ConfigParser(defaults=None, dict_type=<class 'dict'>, allow_no_value=False, *, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section='DEFAULT', interpolation=<object object>, converters=<object object>)[source]

Bases: ConfigParser

ConfigParser with case-sensitive keys (default forces lowercase).

optionxform(option)[source]
class pkgdev.cli.Tool(parser, outfile=None, errfile=None)[source]

Bases: Tool

main()[source]

Execute the main script function.