File tree 3 files changed +12
-3
lines changed 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change
1
+ Add 'remove' command as an alias to 'uninstall' .
Original file line number Diff line number Diff line change 9
9
ConfigOptionParser ,
10
10
UpdatingDefaultsHelpFormatter ,
11
11
)
12
- from pip ._internal .commands import commands_dict , get_similar_commands
12
+ from pip ._internal .commands import (
13
+ commands_aliases ,
14
+ commands_dict ,
15
+ get_similar_commands
16
+ )
13
17
from pip ._internal .exceptions import CommandError
14
18
from pip ._internal .utils .misc import get_pip_version , get_prog
15
19
from pip ._internal .utils .typing import MYPY_CHECK_RUNNING
@@ -83,7 +87,9 @@ def parse_command(args):
83
87
# the subcommand name
84
88
cmd_name = args_else [0 ]
85
89
86
- if cmd_name not in commands_dict :
90
+ if cmd_name in commands_aliases :
91
+ cmd_name = commands_aliases [cmd_name ]
92
+ elif cmd_name not in commands_dict :
87
93
guess = get_similar_commands (cmd_name )
88
94
89
95
msg = ['unknown command "{}"' .format (cmd_name )]
Original file line number Diff line number Diff line change 17
17
from pip ._internal .utils .typing import MYPY_CHECK_RUNNING
18
18
19
19
if MYPY_CHECK_RUNNING :
20
- from typing import Any
20
+ from typing import Any , Dict
21
21
from pip ._internal .cli .base_command import Command
22
22
23
23
94
94
)),
95
95
]) # type: OrderedDict[str, CommandInfo]
96
96
97
+ command_aliases = {'remove' : 'uninstall' } # type: Dict[str, str]
98
+
97
99
98
100
def create_command (name , ** kwargs ):
99
101
# type: (str, **Any) -> Command
You can’t perform that action at this time.
0 commit comments