configoose.cli package

Subpackages

Submodules

configoose.cli.util module

configoose.cli.util.edit_file(filename)

Launch platform-dependent editor to edit a file

configoose.cli.util.format_desc(s, width=70)

Function to format description in argparse arguments

Usage:

arparse.ArgumentParser(
    ...
    description = format_desc(...),
    formatter_class=argparse.RawTextHelpFormatter,
    ...
)
configoose.cli.util.random_address() str

Generate a random address

Module contents

configoose.cli.gather_command()

Function used internally to gather implemented subcommands

class configoose.cli.main(*args, **kwargs)

Bases: algorithm

Implementation of configoose’s command line interface. Here is its main usage string

usage: python -m configoose [-h] [COMMAND]

Run various commands relative to configoose.

positional arguments:
COMMAND     Subcommand to run. Use COMMAND -h for details

options:
-h, --help  Print this help to standard output and exit

Available commands:

conf                 Create file `configooseconf.py` or `userconfigooseconf.py`
find                 Find configuration file
marina-list          Display a list of known marinas
moor                 Moor a configuration file in a marina
random-address       Generate a random address
template             Create a template configuration file for a given protocol
unmoor               Unmoor a configuration file
version              Print program's version
print_help(parser)
run(args)
subcommand = Table({'marina-list': <function marina_list_>, 'random-address': <function random_address_>, 'template': <function template_>, 'version': <function version_>}, {}, {})
configoose.cli.marina_list_(command, args)

Display a list of known marinas

Implementation of the marina-list subcommand. Its usage string is

usage: python -m configoose marina-list [-h]

Display a list of known marinas

options:
-h, --help  show this help message and exit
configoose.cli.random_address_(command, args)

Generate a random address

Implementation of the random-address subcommand which usage string is

usage: python -m configoose random-address [-h]

Generate a random address

options:
-h, --help  show this help message and exit
configoose.cli.template_(command, args)

Print a template configuration for a protocol

Implementation of the template subcommand which usage string is

usage: python -m configoose template [-h] [-a ADDRESS] [-o [OUTFILE]] PROTOCOL

Print a template configuration for a protocol

positional arguments:
PROTOCOL

options:
-h, --help            show this help message and exit
-a ADDRESS, --address ADDRESS
                        configuration address, defaults to random
-o [OUTFILE], --output [OUTFILE]
                        destination file. If not given or equal to '-', print to stdout
configoose.cli.version_(command, args)

Print the package version

Implementation of the version subcommand which usage string is

usage: python -m configoose version [-h]

Print the package version

options:
-h, --help  show this help message and exit