blob: b257904328d2f5dc3b5f07e7d6c883fb9e2055a9 [file] [log] [blame]
Nick Coghlan60f08c82013-11-30 17:45:09 +10001"""Basic pip uninstallation support, helper for the Windows uninstaller"""
2
3import argparse
4import ensurepip
Igor Filatov9adda0c2017-09-21 13:07:45 +03005import sys
Nick Coghlan60f08c82013-11-30 17:45:09 +10006
7
Nick Coghlanf71cae02013-12-23 18:20:34 +10008def _main(argv=None):
Nick Coghlan60f08c82013-11-30 17:45:09 +10009 parser = argparse.ArgumentParser(prog="python -m ensurepip._uninstall")
10 parser.add_argument(
11 "--version",
12 action="version",
13 version="pip {}".format(ensurepip.version()),
14 help="Show the version of pip this will attempt to uninstall.",
15 )
16 parser.add_argument(
17 "-v", "--verbose",
18 action="count",
19 default=0,
20 dest="verbosity",
21 help=("Give more output. Option is additive, and can be used up to 3 "
22 "times."),
23 )
24
Nick Coghlanf71cae02013-12-23 18:20:34 +100025 args = parser.parse_args(argv)
Nick Coghlan60f08c82013-11-30 17:45:09 +100026
Igor Filatov9adda0c2017-09-21 13:07:45 +030027 return ensurepip._uninstall_helper(verbosity=args.verbosity)
Nick Coghlan60f08c82013-11-30 17:45:09 +100028
29
30if __name__ == "__main__":
Igor Filatov9adda0c2017-09-21 13:07:45 +030031 sys.exit(_main())