~ubuntu-branches/ubuntu/trusty/python3.4/trusty-proposed

« back to all changes in this revision

Viewing changes to Lib/ensurepip/__main__.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-11-25 09:44:27 UTC
  • Revision ID: package-import@ubuntu.com-20131125094427-lzxj8ap5w01lmo7f
Tags: upstream-3.4~b1
ImportĀ upstreamĀ versionĀ 3.4~b1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import argparse
 
2
import ensurepip
 
3
 
 
4
 
 
5
def main():
 
6
    parser = argparse.ArgumentParser(prog="python -m ensurepip")
 
7
    parser.add_argument(
 
8
        "--version",
 
9
        action="version",
 
10
        version="pip {}".format(ensurepip.version()),
 
11
        help="Show the version of pip that is bundled with this Python.",
 
12
    )
 
13
    parser.add_argument(
 
14
        "-v", "--verbose",
 
15
        action="count",
 
16
        default=0,
 
17
        dest="verbosity",
 
18
        help=("Give more output. Option is additive, and can be used up to 3 "
 
19
              "times."),
 
20
    )
 
21
    parser.add_argument(
 
22
        "-U", "--upgrade",
 
23
        action="store_true",
 
24
        default=False,
 
25
        help="Upgrade pip and dependencies, even if already installed.",
 
26
    )
 
27
    parser.add_argument(
 
28
        "--user",
 
29
        action="store_true",
 
30
        default=False,
 
31
        help="Install using the user scheme.",
 
32
    )
 
33
    parser.add_argument(
 
34
        "--root",
 
35
        default=None,
 
36
        help="Install everything relative to this alternate root directory.",
 
37
    )
 
38
    parser.add_argument(
 
39
        "--altinstall",
 
40
        action="store_true",
 
41
        default=False,
 
42
        help=("Make an alternate install, installing only the X.Y versioned"
 
43
              "scripts (Default: pipX, pipX.Y, easy_install-X.Y)"),
 
44
    )
 
45
    parser.add_argument(
 
46
        "--default-pip",
 
47
        action="store_true",
 
48
        default=False,
 
49
        help=("Make a default pip install, installing the unqualified pip "
 
50
              "and easy_install in addition to the versioned scripts"),
 
51
    )
 
52
 
 
53
    args = parser.parse_args()
 
54
 
 
55
    ensurepip.bootstrap(
 
56
        root=args.root,
 
57
        upgrade=args.upgrade,
 
58
        user=args.user,
 
59
        verbosity=args.verbosity,
 
60
        altinstall=args.altinstall,
 
61
        default_pip=args.default_pip,
 
62
    )
 
63
 
 
64
 
 
65
if __name__ == "__main__":
 
66
    main()