Class: TheFox::Timr::Command::StatusCommand
- Inherits:
-
BasicCommand
- Object
- BasicCommand
- TheFox::Timr::Command::StatusCommand
- Includes:
- Error
- Defined in:
- lib/timr/command/status_command.rb
Overview
Print [Stack](TheFox::Timr::Model::Stack) Status.
Man page: [timr-status(1)](../../../../man/timr-status.1.html)
Constant Summary collapse
- MAN_PATH =
Path to man page.
'man/timr-status.1'
Instance Attribute Summary
Attributes inherited from BasicCommand
Instance Method Summary collapse
-
#initialize(argv = Array.new) ⇒ StatusCommand
constructor
A new instance of StatusCommand.
-
#run ⇒ Object
See BasicCommand#run.
Methods inherited from BasicCommand
create_command_from_argv, get_command_class_by_name, #shutdown
Constructor Details
#initialize(argv = Array.new) ⇒ StatusCommand
Returns a new instance of StatusCommand.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# 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 |