1 |
commit: 9f6c6d2fd749df7528fcb2b7a85790362fb4d232 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 5 02:00:35 2014 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Mon May 5 02:00:35 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mirrorselect.git;a=commit;h=9f6c6d2f |
7 |
|
8 |
main.py: Sort the cli options |
9 |
|
10 |
--- |
11 |
mirrorselect/main.py | 60 ++++++++++++++++++++++++++-------------------------- |
12 |
1 file changed, 30 insertions(+), 30 deletions(-) |
13 |
|
14 |
diff --git a/mirrorselect/main.py b/mirrorselect/main.py |
15 |
index 3014c3f..d17a4f1 100755 |
16 |
--- a/mirrorselect/main.py |
17 |
+++ b/mirrorselect/main.py |
18 |
@@ -162,19 +162,24 @@ class MirrorSelect(object): |
19 |
" For the -r, --rsync option, it will select the rotation server " |
20 |
"only. As multiple rsync URL's are not supported.") |
21 |
group.add_option( |
22 |
- "-i", "--interactive", action="store_true", default=False, |
23 |
- help="Interactive Mode, this will present a list " |
24 |
- "to make it possible to select mirrors you wish to use.") |
25 |
- group.add_option( |
26 |
"-D", "--deep", action="store_true", default=False, |
27 |
help="Deep mode. This is used to give a more accurate " |
28 |
"speed test. It will download a 100k file from " |
29 |
"each server. Because of this you should only use " |
30 |
"this option if you have a good connection.") |
31 |
+ group.add_option( |
32 |
+ "-i", "--interactive", action="store_true", default=False, |
33 |
+ help="Interactive Mode, this will present a list " |
34 |
+ "to make it possible to select mirrors you wish to use.") |
35 |
|
36 |
group = parser.add_option_group( |
37 |
"Server type selection (choose at most one)") |
38 |
group.add_option( |
39 |
+ "-c", "--country", action="store", default=None, |
40 |
+ help="only use mirrors from the specified country " |
41 |
+ "NOTE: Names with a space must be quoted " |
42 |
+ "eg.: -c 'South Korea'") |
43 |
+ group.add_option( |
44 |
"-F", "--ftp", action="store_true", default=False, |
45 |
help="ftp only mode. Will not consider hosts of other " |
46 |
"types.") |
47 |
@@ -186,29 +191,19 @@ class MirrorSelect(object): |
48 |
help="rsync mode. Allows you to interactively select your" |
49 |
" rsync mirror. Requires -i or -a to be used.") |
50 |
group.add_option( |
51 |
+ "-R", "--region", action="store", default=None, |
52 |
+ help="only use mirrors from the specified region " |
53 |
+ "NOTE: Names with a space must be quoted " |
54 |
+ "eg.: -R 'North America'") |
55 |
+ group.add_option( |
56 |
"-4", "--ipv4", action="store_true", default=False, |
57 |
help="only use IPv4") |
58 |
group.add_option( |
59 |
"-6", "--ipv6", action="store_true", default=False, |
60 |
help="only use IPv6") |
61 |
- group.add_option( |
62 |
- "-c", "--country", action="store", default=None, |
63 |
- help="only use mirrors from the specified country " |
64 |
- "NOTE: Names with a space must be quoted " |
65 |
- "eg.: -c 'South Korea'") |
66 |
- group.add_option( |
67 |
- "-R", "--region", action="store", default=None, |
68 |
- help="only use mirrors from the specified region " |
69 |
- "NOTE: Names with a space must be quoted " |
70 |
- "eg.: -R 'North America'") |
71 |
|
72 |
group = parser.add_option_group("Other options") |
73 |
group.add_option( |
74 |
- "-o", "--output", action="store_true", default=False, |
75 |
- help="Output Only Mode, this is especially useful " |
76 |
- "when being used during installation, to redirect " |
77 |
- "output to a file other than %s" % config_path) |
78 |
- group.add_option( |
79 |
"-b", "--blocksize", action="store", type="int", |
80 |
help="This is to be used in automatic mode " |
81 |
"and will split the hosts into blocks of BLOCKSIZE for " |
82 |
@@ -216,20 +211,9 @@ class MirrorSelect(object): |
83 |
"routers which block 40+ requests at any given time. " |
84 |
"Recommended parameters to pass are: -s3 -b10") |
85 |
group.add_option( |
86 |
- "-t", "--timeout", action="store", type="int", |
87 |
- default="10", help="Timeout for deep mode. Defaults to 10 seconds.") |
88 |
- group.add_option( |
89 |
- "-s", "--servers", action="store", type="int", default=1, |
90 |
- help="Specify Number of servers for Automatic Mode " |
91 |
- "to select. this is only valid for download mirrors. " |
92 |
- "If this is not specified, a default of 1 is used.") |
93 |
- group.add_option( |
94 |
"-d", "--debug", action="store", type="int", dest="verbosity", |
95 |
default=1, help="debug mode, pass in the debug level [1-9]") |
96 |
group.add_option( |
97 |
- "-q", "--quiet", action="store_const", const=0, dest="verbosity", |
98 |
- help="Quiet mode") |
99 |
- group.add_option( |
100 |
"-f", "--file", action="store", default='mirrorselect-test', |
101 |
help="An alternate file to download for deep testing. " |
102 |
"Please choose the file carefully as to not abuse the system " |
103 |
@@ -241,10 +225,26 @@ class MirrorSelect(object): |
104 |
help="An alternate file md5sum value used to compare the downloaded " |
105 |
"file against for deep testing.") |
106 |
group.add_option( |
107 |
+ "-o", "--output", action="store_true", default=False, |
108 |
+ help="Output Only Mode, this is especially useful " |
109 |
+ "when being used during installation, to redirect " |
110 |
+ "output to a file other than %s" % config_path) |
111 |
+ group.add_option( |
112 |
"-P", "--proxy", action="store", |
113 |
default=None, |
114 |
help="Proxy server to use if not the default proxy " |
115 |
"in the environment") |
116 |
+ group.add_option( |
117 |
+ "-q", "--quiet", action="store_const", const=0, dest="verbosity", |
118 |
+ help="Quiet mode") |
119 |
+ group.add_option( |
120 |
+ "-s", "--servers", action="store", type="int", default=1, |
121 |
+ help="Specify Number of servers for Automatic Mode " |
122 |
+ "to select. this is only valid for download mirrors. " |
123 |
+ "If this is not specified, a default of 1 is used.") |
124 |
+ group.add_option( |
125 |
+ "-t", "--timeout", action="store", type="int", |
126 |
+ default="10", help="Timeout for deep mode. Defaults to 10 seconds.") |