bin/alog in autoproj-2.14.0 vs bin/alog in autoproj-2.15.0
- old
+ new
@@ -1,12 +1,12 @@
#! /usr/bin/env ruby
-require 'autoproj/cli/main'
-require 'autoproj/cli/locate'
+require "autoproj/cli/main"
+require "autoproj/cli/locate"
argv = Autoproj::CLI.basic_setup
-if argv.include?('--help') || argv.include?('help')
+if argv.include?("--help") || argv.include?("help")
puts "Usage:"
puts " alog [package]"
puts
puts "Shows log available for the given package and allows to select and display one"
exit 0
@@ -14,13 +14,11 @@
Autoproj.report(silent: true) do
cli = Autoproj::CLI::Locate.new
arg = argv.first || Dir.pwd
- if File.directory?(arg)
- arg = "#{File.expand_path(arg)}/"
- end
+ arg = "#{File.expand_path(arg)}/" if File.directory?(arg)
log_files = cli.logs_of(arg, log: nil)
if log_files.size == 1
logfile = log_files.first
puts File.read(logfile)
@@ -29,8 +27,8 @@
logfile = cli.select_log_file(log_files)
puts File.read(logfile)
rescue Interrupt
end
elsif log_files.empty?
- raise "no logs found for #{string}"
+ raise "no logs found for #{arg}"
end
end