Class: Fav::ListCommand

Inherits:
FavCommand show all
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

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_groupObject

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