Skip to content

Commit

Permalink
force arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 14, 2020
1 parent 5fd969a commit 910e419
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ytools/y2tool/analyze_logs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,17 @@ end
logger = "/dev/null"
output = nil

OptionParser.new do |opts|
opts.banner = "Usage: analyze_logs [options] [paths...]\nDefaults: analyze_logs ." + File::SEPARATOR
parser = OptionParser.new do |opts|
opts.banner = "Usage: analyze_logs [options] path [other paths...]\nDefaults: analyze_logs <path>"
opts.on("-l", "--log LOG", "File to which log") { |o| logger = o }
opts.on("-o", "--output OUTPUT", "File to which YAML will be written.") { |o| output = o }
end.parse!
end
parser.parse!

if ARGV.empty?
STDERR.puts parser.help
exit 1
end

@log = Logger.new(logger)

Expand All @@ -128,9 +134,6 @@ def log
end

ARGV.each { |f| single_file(result, f) }
if ARGV.empty?
single_file(result, ".")
end

final = result.to_yaml
if output
Expand Down

0 comments on commit 910e419

Please sign in to comment.