diff options
-rw-r--r-- | mirrorselect.8 | 3 | ||||
-rwxr-xr-x | mirrorselect/main.py | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/mirrorselect.8 b/mirrorselect.8 index cd7b8bb..3a1e304 100644 --- a/mirrorselect.8 +++ b/mirrorselect.8 @@ -96,6 +96,9 @@ download mirrors. If this is not specified, a default of 1 is used. .TP .BI \-t " TIMEOUT " "\fR,\fP \-timeout" " TIMEOUT " Timeout for deep mode. Defaults to 10 seconds. +.TP +.BI \-e " EXCLUDE " "\fR,\fP \-exclude" " EXCLUDE " +Exclude host from mirrors list. .SH "EXAMPLES" automatic: diff --git a/mirrorselect/main.py b/mirrorselect/main.py index 04698f3..b49461b 100755 --- a/mirrorselect/main.py +++ b/mirrorselect/main.py @@ -243,6 +243,9 @@ class MirrorSelect(object): group.add_option( "-t", "--timeout", action="store", type="int", default="10", help="Timeout for deep mode. Defaults to 10 seconds.") + group.add_option( + "-e", "--exclude", action="append", dest="exclude", + default=None, help="Exclude host from mirrors list.") @@ -302,6 +305,10 @@ class MirrorSelect(object): else: self.output.write("using url: %s\n" % MIRRORS_3_XML, 2) hosts = Extractor(MIRRORS_3_XML, options, self.output).hosts + + if options.exclude: + hosts = [x for x in hosts if x[0] not in options.exclude] + return hosts |