Sha256: 8a74ba9a6d6a680d0c69f348f857b88febd0ab07ea14aba935e386e2dfc7ef34

Contents?: true

Size: 877 Bytes

Versions: 6

Compression:

Stored size: 877 Bytes

Contents

#! /usr/bin/env ruby

require "autoproj/cli/main"
require "autoproj/cli/locate"

argv = Autoproj::CLI.basic_setup
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
end

Autoproj.report(silent: true) do
    cli = Autoproj::CLI::Locate.new

    arg = argv.first || Dir.pwd
    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)
    elsif log_files.size > 1
        begin
            logfile = cli.select_log_file(log_files)
            puts File.read(logfile)
        rescue Interrupt
        end
    elsif log_files.empty?
        raise "no logs found for #{arg}"
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
autoproj-2.17.0 bin/alog
autoproj-2.16.0 bin/alog
autoproj-2.15.3 bin/alog
autoproj-2.15.2 bin/alog
autoproj-2.15.1 bin/alog
autoproj-2.15.0 bin/alog