class TheFox::Timr::Command::HelpCommand

Print the overview help page.

Public Class Methods

new(argv = Array.new) click to toggle source
Calls superclass method TheFox::Timr::Command::BasicCommand.new
# File lib/timr/command/help_command.rb, line 9
def initialize(argv = Array.new)
    # puts "help #{argv}"
    
    super()
    
    @command_opt = nil
    
    loop_c = 0 # Limit the loop.
    while loop_c < 1024 && argv.length > 0
        loop_c += 1
        
        unless @command_opt
            @command_opt = argv.shift
        end
    end
end
print_datetime_help() click to toggle source

Print DateTime help.

print_estimation_help(ext = false) click to toggle source

Print Estimation help.

print_id_help() click to toggle source

Alias

print_man_units_help() click to toggle source

Print Man Units help.

print_task_id_help() click to toggle source

Print help about Task ID.

print_track_id_help() click to toggle source

Print help about Track ID.

Public Instance Methods

run() click to toggle source

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

# File lib/timr/command/help_command.rb, line 27
def run
    if @command_opt
        command_class = BasicCommand.get_command_class_by_name(@command_opt)
        
        if defined?(command_class::MAN_PATH)
            system("man #{command_class::MAN_PATH}")
        else
            raise HelpCommandError, "No manual page found for '#{@command_opt}'. See 'timr --help'."
        end
    else
        help
    end
end