mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
fix '-h,--help' option for commands
This commit is contained in:
parent
64f4caed7d
commit
4ec46922ff
3 changed files with 3 additions and 3 deletions
|
@ -109,7 +109,7 @@ def parseopts(args):
|
|||
sys.exit()
|
||||
|
||||
# pip || pip help || pip --help -> print_help()
|
||||
if options.help or not args or (args[0] == 'help' and len(args) == 1):
|
||||
if not args or (args[0] == 'help' and len(args) == 1):
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class Command(object):
|
|||
def _copy_options(self, parser, options):
|
||||
"""Populate an option parser or group with options."""
|
||||
for option in options:
|
||||
if not option.dest or option.dest == 'help':
|
||||
if not option.dest:
|
||||
continue
|
||||
parser.add_option(option)
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ standard_options = [
|
|||
optparse.make_option(
|
||||
'-h', '--help',
|
||||
dest='help',
|
||||
action='store_true',
|
||||
action='help',
|
||||
help='Show help'),
|
||||
|
||||
optparse.make_option(
|
||||
|
|
Loading…
Reference in a new issue