Skip to content

Commit

Permalink
Revert "Raise error if --user and --target arguments are used together"
Browse files Browse the repository at this point in the history
This reverts commit b6d775d.
  • Loading branch information
sinscary committed Feb 27, 2020
1 parent 8380b2b commit 268a2dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
1 change: 0 additions & 1 deletion news/7249.feature

This file was deleted.

19 changes: 5 additions & 14 deletions src/pip/_internal/cli/main_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,6 @@ def parse_command(args):
# the subcommand name
cmd_name = args_else[0]

validate_command_args(cmd_name, args_else)

# all the args without the subcommand
cmd_args = args[:]
cmd_args.remove(cmd_name)

return cmd_name, cmd_args


def validate_command_args(cmd_name, args_else):
# type: (str, List[str]) -> None
if cmd_name not in commands_dict:
guess = get_similar_commands(cmd_name)

Expand All @@ -103,6 +92,8 @@ def validate_command_args(cmd_name, args_else):

raise CommandError(' - '.join(msg))

if set(['--user', '--target']).issubset(set(args_else)):
error_msg = '--user and --target cant not be used together.'
raise CommandError(error_msg)
# all the args without the subcommand
cmd_args = args[:]
cmd_args.remove(cmd_name)

return cmd_name, cmd_args

0 comments on commit 268a2dd

Please sign in to comment.