forked from conda/conda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_remove.py
52 lines (38 loc) · 1.33 KB
/
main_remove.py
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
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, print_function
from argparse import Namespace, RawDescriptionHelpFormatter
from conda.cli.conda_argparse import add_output_and_prompt_options, add_parser_prefix
_help = "Remove an environment"
_description = _help + """
Removes a provided environment. You must deactivate the existing
environment before you can remove it.
""".lstrip()
_example = """
Examples:
conda env remove --name FOO
conda env remove -n FOO
"""
def configure_parser(sub_parsers):
p = sub_parsers.add_parser(
'remove',
formatter_class=RawDescriptionHelpFormatter,
description=_description,
help=_help,
epilog=_example,
)
add_parser_prefix(p)
add_output_and_prompt_options(p)
p.set_defaults(func='.main_remove.execute')
def execute(args, parser):
import conda.cli.main_remove
args = vars(args)
args.update({
'all': True, 'channel': None, 'features': None,
'override_channels': None, 'use_local': None, 'use_cache': None,
'offline': None, 'force': True, 'pinned': None})
args = Namespace(**args)
from conda.base.context import context
context.__init__(argparse_args=args)
conda.cli.main_remove.execute(args, parser)