File size: 1,505 Bytes
71687cf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""CLI implementation for `conda-env remove`.
Removes the specified conda environment.
"""
from argparse import (
ArgumentParser,
_SubParsersAction,
)
def configure_parser(sub_parsers: _SubParsersAction, **kwargs) -> ArgumentParser:
from ..auxlib.ish import dals
from .helpers import (
add_output_and_prompt_options,
add_parser_frozen_env,
add_parser_prefix,
add_parser_solver,
)
summary = "Remove an environment."
description = dals(
f"""
{summary}
Removes a provided environment. You must deactivate the existing
environment before you can remove it.
"""
)
epilog = dals(
"""
Examples::
conda env remove --name FOO
conda env remove -n FOO
"""
)
p = sub_parsers.add_parser(
"remove",
help=summary,
description=description,
epilog=epilog,
**kwargs,
)
add_parser_frozen_env(p)
add_parser_prefix(p)
add_parser_solver(p)
add_output_and_prompt_options(p)
p.set_defaults(
func="conda.cli.main_remove.execute",
all=True,
channel=None,
features=None,
override_channels=None,
use_local=None,
use_cache=None,
offline=None,
package_names=[],
force=True,
pinned=None,
keep_env=False,
)
return p
|