Class: Fav::ListCommand
- Inherits:
-
FavCommand
- Object
- FavCommand
- Fav::ListCommand
- Defined in:
- lib/fav.rb
Overview
A command to list commands
Instance Attribute Summary
Attributes inherited from FavCommand
#cli_options, #command_args, #command_name, #command_options, #config, #favs_file
Instance Method Summary collapse
-
#on_group(group) ⇒ Object
List commands in the group.
-
#on_non_group ⇒ Object
List all commands.
Methods inherited from FavCommand
#initialize, #post_group, #run!
Constructor Details
This class inherits a constructor from Fav::FavCommand
Instance Method Details
#on_group(group) ⇒ Object
List commands in the group
122 123 124 |
# File 'lib/fav.rb', line 122 def on_group(group) self.config[group].each { |cmd_name, cmd_value| print_command(cmd_name, cmd_value) } end |
#on_non_group ⇒ Object
List all commands
127 128 129 130 |
# File 'lib/fav.rb', line 127 def on_non_group file = File.open(self.favs_file, "rb") puts file.read end |