class TheFox::Timr::Command::HelpCommand

Print the overview help page.

Public Class Methods

new(argv = Array.new) click to toggle source
# 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 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

Private Instance Methods

help() click to toggle source
# File lib/timr/command/help_command.rb, line 102
def help
        puts 'usage: timr [-V|--version] [-h|--help] [-C <path>] <command> [<args>]'
        puts
        puts '    -V, --version    Show version.'
        puts '    -h, --help       Show help.'
        puts '    -C <path>        Set path to the project base directory.'
        puts '                     Default: ~/.timr/defaultc'
        puts
        puts 'Commands'
        puts '    start            Start working on a Task.'
        puts '    stop             Stop the current running Task/Track.'
        puts
        puts '    pause            Pause the Top Track of the Stack.'
        puts '    continue         Continue the Top Track of the Stack.'
        puts
        puts '    push             Push a new Track on the Stack and pause the old one.'
        puts '    pop              Pop the Top Track and continue the old one.'
        puts
        puts '    status           Show the current Stack.'
        puts '    log              Show recent Tracks.'
        puts
        puts "    task             Task related commands. See 'timr task --help'."
        puts "    track            Track related commands. See 'timr track --help'."
        puts
        puts '    report           Generate a report.'
        puts
        puts "See 'timr <command> --help' to read details about a specific command,"
        puts " or 'timr help <command>' to open the man page for this command."
        puts "Also see 'man' directory for available man pages."
end