fix option checking

This commit is contained in:
Ward Wouts 2002-07-04 22:28:26 +00:00
parent c5d8636c65
commit a6acfd99fc

View file

@ -53,7 +53,6 @@ def save_file(dir, name, data)
return true
end
# meuh, dit werkt nu niet :( mag dit wel in een def staan?
def parse_options(options)
begin
opts = GetoptLong.new(
@ -72,17 +71,20 @@ def parse_options(options)
opts.each do |opt, arg|
options[opt] = arg
end
rescue
print "#{opts.error_message}\n"
print "\nUsage:\n"
exit
rescue GetoptLong::InvalidOption
print "#{$!}\n"
usage
end
#print opts.error_message
#print "Remaining args: #{ARGV.join(', ')}\n"
return options
end
def usage
print "\nUsage:\n"
print "blabla hier nog iets verzinnen\n"
exit
end
def parse_config(default = {})
file = File.new("#{default[\"-c\"]}")
lines = file.readlines
@ -325,7 +327,7 @@ for group in @config.keys.sort
mode, filename, body = get_multi(i, group)
end
output_data(i, mode, filename, body) if mode != false
rescue Article::BodyError
rescue Article::TempError
print "Skipping article...\n"
next
end