nieuwe mogelijkheid om

a) een specifieke group op te halen (-g <group>)
b) de geconfigureerde groupen te tonen (-l)
This commit is contained in:
Ward Wouts 2008-02-06 12:06:03 +00:00
parent c6b9ecc37a
commit 4c2599942f

View file

@ -206,6 +206,9 @@ def parse_options(options)
opts = GetoptLong.new(
[ "-I", "--include", GetoptLong::REQUIRED_ARGUMENT ],
[ "-c", "--configfile", GetoptLong::REQUIRED_ARGUMENT ],
[ "-g", "--group", GetoptLong::REQUIRED_ARGUMENT ],
[ "-h", "--help", GetoptLong::NO_ARGUMENT ],
[ "-l", "--list", GetoptLong::NO_ARGUMENT ],
[ "-L", "--longname", GetoptLong::NO_ARGUMENT ],
[ "-C", "--combinedname", GetoptLong::NO_ARGUMENT ],
[ "-M", "--multipart", GetoptLong::NO_ARGUMENT ],
@ -223,6 +226,7 @@ def parse_options(options)
puts "#{$!}"
usage
end
options["-h"] && usage
return options
end
@ -231,17 +235,20 @@ def usage
Usage:
ripnews.rb [-I <pattern>] [-c <file>] [-L] [-C] [-M] [-S] [-T] [-X <pattern>]
ripnews.rb [-I <pattern>] [-c <file>] [-g <group] [-L] [-C] [-M] [-S] [-T] [-X <pattern>]
-I <pattern> specify an include pattern
-c <file> specify an alternate configfile
-L use subject as filename
-C use combined filenames
-M get multipart articles
-s exit silently if already running
-S get singlepart articles
-T test mode, don't update newsrc file
-X <pattern> specify an exclude pattern
-I <pattern>, --include <pattern> specify an include pattern
-c <file>, --configfile <file> specify an alternate configfile
-g <group>, --group <group> only rip specified group
-h, --help display this help and exit
-l, --list list configured groups and exit
-L, --longname use subject as filename
-C, --combinedname use combined filenames
-M, --multipart get multipart articles
-s exit silently if already running
-S, --singlepart get singlepart articles
-T, --test test mode, don't update newsrc file
-X <pattern>, --exclude <pattern> specify an exclude pattern
EOT
exit
end
@ -701,11 +708,22 @@ def startup
}
}
end
if @defaults["-l"]
puts "The following groups have been configured:\n\n"
@config.keys.sort.each{|group|
puts group
}
exit
end
end
def main
profile_mem("out side of loop still")
for group in @config.keys.sort
@config.keys.sort.each{|group|
if ! @defaults["-g"].nil? && group != @defaults["-g"]
next
end
@decode_threads = []
@newsrc_lock = Mutex.new
profile_mem("#{group} start")
@ -751,7 +769,7 @@ def main
profile_mem("#{group} pre-GC")
GC.start
profile_mem("#{group} end")
end
}
end
def ending