Nick Coghlan | 60f08c8 | 2013-11-30 17:45:09 +1000 | [diff] [blame] | 1 | """Basic pip uninstallation support, helper for the Windows uninstaller""" |
| 2 | |
| 3 | import argparse |
| 4 | import ensurepip |
| 5 | |
| 6 | |
Nick Coghlan | f71cae0 | 2013-12-23 18:20:34 +1000 | [diff] [blame] | 7 | def _main(argv=None): |
Nick Coghlan | 60f08c8 | 2013-11-30 17:45:09 +1000 | [diff] [blame] | 8 | parser = argparse.ArgumentParser(prog="python -m ensurepip._uninstall") |
| 9 | parser.add_argument( |
| 10 | "--version", |
| 11 | action="version", |
| 12 | version="pip {}".format(ensurepip.version()), |
| 13 | help="Show the version of pip this will attempt to uninstall.", |
| 14 | ) |
| 15 | parser.add_argument( |
| 16 | "-v", "--verbose", |
| 17 | action="count", |
| 18 | default=0, |
| 19 | dest="verbosity", |
| 20 | help=("Give more output. Option is additive, and can be used up to 3 " |
| 21 | "times."), |
| 22 | ) |
| 23 | |
Nick Coghlan | f71cae0 | 2013-12-23 18:20:34 +1000 | [diff] [blame] | 24 | args = parser.parse_args(argv) |
Nick Coghlan | 60f08c8 | 2013-11-30 17:45:09 +1000 | [diff] [blame] | 25 | |
Nick Coghlan | f71cae0 | 2013-12-23 18:20:34 +1000 | [diff] [blame] | 26 | ensurepip._uninstall_helper(verbosity=args.verbosity) |
Nick Coghlan | 60f08c8 | 2013-11-30 17:45:09 +1000 | [diff] [blame] | 27 | |
| 28 | |
| 29 | if __name__ == "__main__": |
Nick Coghlan | f71cae0 | 2013-12-23 18:20:34 +1000 | [diff] [blame] | 30 | _main() |