nieuwe mogelijkheid om
a) een specifieke group op te halen (-g <group>) b) de geconfigureerde groupen te tonen (-l)
This commit is contained in:
parent
c6b9ecc37a
commit
4c2599942f
1 changed files with 30 additions and 12 deletions
|
|
@ -206,6 +206,9 @@ def parse_options(options)
|
||||||
opts = GetoptLong.new(
|
opts = GetoptLong.new(
|
||||||
[ "-I", "--include", GetoptLong::REQUIRED_ARGUMENT ],
|
[ "-I", "--include", GetoptLong::REQUIRED_ARGUMENT ],
|
||||||
[ "-c", "--configfile", 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 ],
|
[ "-L", "--longname", GetoptLong::NO_ARGUMENT ],
|
||||||
[ "-C", "--combinedname", GetoptLong::NO_ARGUMENT ],
|
[ "-C", "--combinedname", GetoptLong::NO_ARGUMENT ],
|
||||||
[ "-M", "--multipart", GetoptLong::NO_ARGUMENT ],
|
[ "-M", "--multipart", GetoptLong::NO_ARGUMENT ],
|
||||||
|
|
@ -223,6 +226,7 @@ def parse_options(options)
|
||||||
puts "#{$!}"
|
puts "#{$!}"
|
||||||
usage
|
usage
|
||||||
end
|
end
|
||||||
|
options["-h"] && usage
|
||||||
return options
|
return options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -231,17 +235,20 @@ def usage
|
||||||
|
|
||||||
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
|
-I <pattern>, --include <pattern> specify an include pattern
|
||||||
-c <file> specify an alternate configfile
|
-c <file>, --configfile <file> specify an alternate configfile
|
||||||
-L use subject as filename
|
-g <group>, --group <group> only rip specified group
|
||||||
-C use combined filenames
|
-h, --help display this help and exit
|
||||||
-M get multipart articles
|
-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 exit silently if already running
|
||||||
-S get singlepart articles
|
-S, --singlepart get singlepart articles
|
||||||
-T test mode, don't update newsrc file
|
-T, --test test mode, don't update newsrc file
|
||||||
-X <pattern> specify an exclude pattern
|
-X <pattern>, --exclude <pattern> specify an exclude pattern
|
||||||
EOT
|
EOT
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
@ -701,11 +708,22 @@ def startup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if @defaults["-l"]
|
||||||
|
puts "The following groups have been configured:\n\n"
|
||||||
|
@config.keys.sort.each{|group|
|
||||||
|
puts group
|
||||||
|
}
|
||||||
|
exit
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def main
|
def main
|
||||||
profile_mem("out side of loop still")
|
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 = []
|
@decode_threads = []
|
||||||
@newsrc_lock = Mutex.new
|
@newsrc_lock = Mutex.new
|
||||||
profile_mem("#{group} start")
|
profile_mem("#{group} start")
|
||||||
|
|
@ -751,7 +769,7 @@ def main
|
||||||
profile_mem("#{group} pre-GC")
|
profile_mem("#{group} pre-GC")
|
||||||
GC.start
|
GC.start
|
||||||
profile_mem("#{group} end")
|
profile_mem("#{group} end")
|
||||||
end
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def ending
|
def ending
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue