pypa/pip — pull request #463 by gvalkov (2012-03-01 22:31:03+00:00)
Title: Rework command handling

Design changes:

* Remove module-singleton baseparser.parser object. A parser instance is
created in pip.main() and passed as the first argument to each command. Each
command can access the main parser from self.main_parser.

* Remove all global command instances. Commands are instantiated on demand in
pip.main(). Deferred command module imports were removed.

* Factor option handling out of pip.main() and into pip.parseopts()

* All pip exceptions inherit from PipError

* Move pip.call_subprocess to pip.util.call_subprocess

Look & feel Changes:

* The list of available commands is now part of the parser's description and
comes before all other options. 'Pip help' is more targeted at showing the
options of a command instead of all available commands.

* Use a prettier/less verbose help formatter that prevents excessive wrapping

* Command specific options are grouped under a 'Command Options' OptionGroup

* General options are grouped under a 'General Options' OptionGroup