mirror of https://github.com/pypa/pip
add the Command.gen_opts option group
Note that commands still have to add the option group to the parser once they populate it with options (self.parser.add_option_group).
This commit is contained in:
parent
2c09666c31
commit
b34feacbf9
|
@ -43,6 +43,9 @@ class Command(object):
|
|||
self.main_parser = main_parser
|
||||
self.parser = ConfigOptionParser(**parser_kw)
|
||||
|
||||
# Commands should add options to this option group
|
||||
self.cmd_opts = optparse.OptionGroup(self.parser, 'Command Options')
|
||||
|
||||
# Re-add all options and option groups.
|
||||
for group in main_parser.option_groups:
|
||||
self._copy_option_group(self.parser, group)
|
||||
|
|
|
@ -23,7 +23,7 @@ class InstallCommand(Command):
|
|||
super(InstallCommand, self).__init__(*args, **kw)
|
||||
|
||||
pypi_opts = optparse.OptionGroup(self.parser, 'Package Index Options')
|
||||
cmd_opts = optparse.OptionGroup(self.parser, 'Command Options')
|
||||
cmd_opts = self.cmd_opts
|
||||
|
||||
pypi_opts.add_option(
|
||||
'-f', '--find-links',
|
||||
|
|
Loading…
Reference in New Issue