Sha256: 1e9c9acb699ef0f4abc968b7cf1dba782ca361abf621eafbb935db79beb3fbf9

Contents?: true

Size: 802 Bytes

Versions: 10

Compression:

Stored size: 802 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
    if File.directory?(arg)
        arg = "#{File.expand_path(arg)}/"
    end
    log_files = cli.logs_of(arg, log: nil)

    if log_files.size == 1
        logfile = log_files.first
    elsif log_files.size > 1
        logfile = cli.select_log_file(log_files)
    elsif log_files.empty?
        raise "no logs found for #{string}"
    end

    puts File.read(logfile)
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
autoproj-2.8.8 bin/alog
autoproj-2.8.7 bin/alog
autoproj-2.8.6 bin/alog
autoproj-2.8.5 bin/alog
autoproj-2.8.5.b1 bin/alog
autoproj-2.8.4 bin/alog
autoproj-2.8.3 bin/alog
autoproj-2.8.2 bin/alog
autoproj-2.8.1 bin/alog
autoproj-2.8.0 bin/alog