Class: Mysh::HistoryCommand
- Defined in:
- lib/mysh/internal/history.rb
Overview
The mysh internal history command.
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(*args) ⇒ HistoryCommand
constructor
Set up this command.
-
#process_command(input) ⇒ Object
Execute the history command.
Methods inherited from Action
#action_info, #process_quick_command, #short_name
Constructor Details
#initialize(*args) ⇒ HistoryCommand
Set up this command.
10 11 12 13 |
# File 'lib/mysh/internal/history.rb', line 10 def initialize(*args) super @args = @history = nil end |
Instance Method Details
#process_command(input) ⇒ Object
Execute the history command.
16 17 18 19 20 21 22 23 |
# File 'lib/mysh/internal/history.rb', line 16 def process_command(input) @args, @history = input.args, Mysh.input.history # The history command should not be part of the history. @history.pop pull_index || clear_history || show_history end |