gui.model.cli_argv

gui.model.cli_argv(root, command, positional=(), options=None)

The arguments of a spotregen command, as spotregen.cli.main takes them.

Parameters

Name Type Description Default
root Path | str The repository root, passed as --root. required
command str One of COMMANDS. required
positional Sequence[str] Positional arguments, for example the unit. ()
options Mapping[str, object] | None Options by long name without dashes; a true value is a bare flag, false and None are left out, a list repeats the flag once per item, any other value is written after the flag (as --flag=value if it starts with a dash). Underscores become hyphens. None

Returns

Name Type Description
list[str] list[str]: The arguments without the program name.

Raises

Name Type Description
ValueError If command is not one the interface offers.

Examples

from spotregen.gui.model import cli_argv, display_command

argv = cli_argv("/work/demo", "check", options={"strict": True})
print(argv)
print(display_command(argv))
['--root', '/work/demo', 'check', '--strict']
spotregen --root /work/demo check --strict