upsies.uis.tui.commands.set
Change or show configuration file options
Classes
- class upsies.uis.tui.commands.set.set(args, config)[source]
Bases:
CommandBaseChange or show configuration file options
Without any arguments, all options are listed with their current values.
OPTION consists of three segments which are delimited with a period (“.”). The first segment in OPTION is the INI file name without the extension. The second segment is the section name in that file. The third segment is the option name.
List values are given as one argument per list item. If non-list values are given as multiple arguments, they are concatenated with single spaces. In the INI file, list items are delimited by one line break and one or more spaces (e.g. “n “).
- names = ('set',)
Sequence of command names
The first name is the full name and the rest are short aliases.
- cli_arguments = {'OPTION': {'help': 'Option to change or show', 'nargs': '?'}, 'VALUE': {'default': '', 'group': 'value', 'help': 'New value for OPTION', 'nargs': '*'}, ('--dump', '-d'): {'group': 'value', 'help': 'Write current configuration to ~/.config/upsies/FILE.ini\nwith commented-out default values\nFILE may be "clients", "config", "imghosts", "trackers", or it may be omitted to write all configuration files.\nWARNING: You will lose any comments and custom structure in your .ini files.', 'metavar': 'FILE', 'nargs': '*', 'type': <function one_of.<locals>.one_of_values>}, ('--fetch-ptpimg-apikey',): {'help': 'Fetch ptpimg API key and save it in ~/.config/upsies/imghosts.ini\n(EMAIL and PASSWORD are not saved)', 'metavar': ('EMAIL', 'PASSWORD'), 'nargs': 2}, ('--options',): {'action': 'store_true', 'help': 'Show description of all configuration options'}, ('--reset', '-r'): {'action': 'store_true', 'group': 'value', 'help': 'Reset OPTION to default value'}}
CLI argument definitions for this command
This is a
dictin which keys are option names or flags (e.g."PATH"or("--path", "-p")and each value is adictwith keyword arguments forargparse.ArgumentParser.add_argument().Additionally, you may specify a
groupin each keyword argument dictionary. Arguments with the samegroupvalue are mutually exclusive, meaning the user can only specify one of them.