2) have `create_main_parser` mark the parser as the 'main' parser.
3) remove an extraneus block that's never called. thanks @netspyer.
4) move 'create_main_parser` to __init__ to avoid circular or embedded imports.
This patch removes the error prone step of merging the baseparsers'
options (the 'Generic Options') with those of the subparser. In fact,
commands are already capable of parsing all options present in the
'Generic Options' option group. The option parsing logic is as follows:
Given a command line such as:
'--timeout 5 install --user pkg'
pip.parseopt() returns command 'install' with arguments:
'--timeout 5 --user pkg'
pip.main() executes the above as:
commands['install'](parser).main('--timeout 5 --user pkg', options)
`pip help <misspelled>` should return the same error message as `pip
<misspelled>`, namely:
ERROR: unknown command "enstall" - maybe you meant "install"
Rework the way commands are defined, loaded and ran in pip:
- Commands are instantiated on demand in pip.main().
- A command 'registry' - mapping of command names to command classes in
pip.commands.__init__.
- Remove deferred command module loading.
Reran tests after changes on 2.4, 2.6, 3.2 all pass.
=====================================================
================== Running pep8 =====================
Searching for pep8
Reading http://pypi.python.org/simple/pep8/
Reading http://github.com/cburroughs/pep8.py/tree/master
Reading http://github.com/jcrocholl/pep8
Best match: pep8 0.6.1
Processing pep8-0.6.1-py2.6.egg
pep8 0.6.1 is already the active version in easy-install.pth
Installing pep8 script to /Users/pnasrat/Development/pip/pip_virtualenv/bin
Using /Users/pnasrat/Development/pip/pip_virtualenv/lib/python2.6/site-packages/pep8-0.6.1-py2.6.egg
Processing dependencies for pep8
Finished processing dependencies for pep8
==================== Ended pep8 =====================
=====================================================