class TheFox::Timr::Command::StatusCommand

Print Stack Status.

Man page: timr-status(1)

Constants

MAN_PATH

Path to man page.

Public Class Methods

new(argv = Array.new) click to toggle source
Calls superclass method TheFox::Timr::Command::BasicCommand.new
# File lib/timr/command/status_command.rb, line 18
def initialize(argv = Array.new)
    super()
    
    @help_opt = false
    
    @verbose_opt = false
    @full_opt = false
    @reverse_opt = false
    
    loop_c = 0 # Limit the loop.
    while loop_c < 1024 && argv.length > 0
        loop_c += 1
        arg = argv.shift
        
        case arg
        when '-h', '--help'
            @help_opt = true
        when '-v', '--verbose'
            @verbose_opt = true
        when '-f', '--full'
            @full_opt = true
        when '-r', '--reverse'
            @reverse_opt = true
        else
            raise StatusCommandError, "Unknown argument '#{arg}'. See 'timr stop --help'."
        end
    end
end

Public Instance Methods

run() click to toggle source

See TheFox::Timr::Command::BasicCommand#run.

# File lib/timr/command/status_command.rb, line 48
def run
    if @help_opt
        help
        return
    end
    
    @timr = Timr.new(@cwd)
    
    if @full_opt
        print_full_table
    else
        print_small_table
    end
end