llama.flags.cli module

CLI tools for Flags.

class llama.flags.cli.FlagAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: argparse.Action

Parses flags provided at the command line. Sets the returned argument to an ImmutableDict containing the desired flags (either specified by preset or explicit deviations from defaults) after validating that the provided values are valid and quitting with a helpful message if they are not.

class llama.flags.cli.Parsers

Bases: object

CLI flags related to flags. Same idea as llama.cli.Parsers but with narrower scope.

flags = CliParser(prog='sphinx-build', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=False)
class llama.flags.cli.PrintFlagsAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: argparse.Action

Action to show flag help and quit.

llama.flags.cli.postprocess_flags(self: llama.cli.CliParser, namespace: argparse.Namespace)

Check whether flags have been specified under --flags. If not, and if this is an interactive session, prompt the user to manually input flags. If not specified and not interactive, raise an error.

llama.flags.cli.postprocess_flags_dry_run(_self: llama.cli.CliParser, namespace: argparse.Namespace)

Print the flags selected by namespace.flags and exit without taking further action if namespace.dry_run_flags.