:py:mod:`helpers` ================= .. py:module:: conda.cli.helpers .. autoapi-nested-parse:: Collection of helper functions to standardize reused CLI arguments. Classes ------- .. autoapisummary:: conda.cli.helpers.BooleanOptionalAction Functions --------- .. autoapisummary:: conda.cli.helpers.add_parser_create_install_update conda.cli.helpers.add_parser_pscheck conda.cli.helpers.add_parser_show_channel_urls conda.cli.helpers.add_parser_help conda.cli.helpers.add_parser_prefix conda.cli.helpers.add_parser_json conda.cli.helpers.add_output_and_prompt_options conda.cli.helpers.add_parser_channels conda.cli.helpers.add_parser_solver_mode conda.cli.helpers.add_parser_update_modifiers conda.cli.helpers.add_parser_prune conda.cli.helpers.add_parser_solver conda.cli.helpers.add_parser_networking conda.cli.helpers.add_parser_package_install_options conda.cli.helpers.add_parser_known conda.cli.helpers.add_parser_default_packages conda.cli.helpers.add_parser_platform conda.cli.helpers.add_parser_verbose .. py:class:: BooleanOptionalAction(option_strings, dest, default=None, type=None, choices=None, required=False, help=None, metavar=None) Bases: :py:obj:`argparse.Action` Information about how to convert command line strings to Python objects. Action objects are used by an ArgumentParser to represent the information needed to parse a single argument from one or more strings from the command line. The keyword arguments to the Action constructor are also all attributes of Action instances. :keyword - option_strings -- A list of command-line option strings which: should be associated with this action. :keyword - dest -- The name of the attribute to hold the created object: :kwtype - dest -- The name of the attribute to hold the created object: s :keyword - nargs -- The number of command-line arguments that should be: consumed. By default, one argument will be consumed and a single value will be produced. Other values include: - N (an integer) consumes N arguments (and produces a list) - '?' consumes zero or one arguments - '*' consumes zero or more arguments (and produces a list) - '+' consumes one or more arguments (and produces a list) Note that the difference between the default and nargs=1 is that with the default, a single value will be produced, while with nargs=1, a list containing a single value will be produced. :keyword - const -- The value to be produced if the option is specified and the: option uses an action that takes no values. :keyword - default -- The value to be produced if the option is not specified.: :keyword - type -- A callable that accepts a single string argument, and: returns the converted value. The standard Python types str, int, float, and complex are useful examples of such callables. If None, str is used. :keyword - choices -- A container of values that should be allowed. If not None,: after a command-line argument has been converted to the appropriate type, an exception will be raised if it is not a member of this collection. :keyword - required -- True if the action must always be specified at the: command line. This is only meaningful for optional command-line arguments. :keyword - help -- The help string describing the argument.: :keyword - metavar -- The name to be used for the option's argument with the: help string. If None, the 'dest' value will be used as the name. .. py:method:: __call__(parser, namespace, values, option_string=None) .. py:method:: format_usage() .. py:function:: add_parser_create_install_update(p, prefix_required=False) .. py:function:: add_parser_pscheck(p: argparse.ArgumentParser) -> None .. py:function:: add_parser_show_channel_urls(p: argparse.ArgumentParser | argparse._ArgumentGroup) -> None .. py:function:: add_parser_help(p: argparse.ArgumentParser) -> None So we can use consistent capitalization and periods in the help. You must use the add_help=False argument to ArgumentParser or add_parser to use this. Add this first to be consistent with the default argparse output. .. py:function:: add_parser_prefix(p: argparse.ArgumentParser, prefix_required: bool = False) -> argparse._MutuallyExclusiveGroup .. py:function:: add_parser_json(p: argparse.ArgumentParser) -> argparse._ArgumentGroup .. py:function:: add_output_and_prompt_options(p: argparse.ArgumentParser) -> argparse._ArgumentGroup .. py:function:: add_parser_channels(p: argparse.ArgumentParser) -> argparse._ArgumentGroup .. py:function:: add_parser_solver_mode(p: argparse.ArgumentParser) -> argparse._ArgumentGroup .. py:function:: add_parser_update_modifiers(solver_mode_options: argparse.ArgumentParser) .. py:function:: add_parser_prune(p: argparse.ArgumentParser) -> None .. py:function:: add_parser_solver(p: argparse.ArgumentParser) -> None Add a command-line flag for alternative solver backends. See ``context.solver`` for more info. .. py:function:: add_parser_networking(p: argparse.ArgumentParser) -> argparse._ArgumentGroup .. py:function:: add_parser_package_install_options(p: argparse.ArgumentParser) -> argparse._ArgumentGroup .. py:function:: add_parser_known(p: argparse.ArgumentParser) -> None .. py:function:: add_parser_default_packages(p: argparse.ArgumentParser) -> None .. py:function:: add_parser_platform(parser) .. py:function:: add_parser_verbose(parser: argparse.ArgumentParser | argparse._ArgumentGroup) -> None