Class: Rly::Commands::List
- Inherits:
-
Rly::Command
- Object
- Rly::Command
- Rly::Commands::List
- Defined in:
- lib/rly/commands/list.rb
Instance Method Summary collapse
- #execute(input: $stdin, output: $stdout) ⇒ Object
-
#initialize(options) ⇒ List
constructor
A new instance of List.
Methods inherited from Rly::Command
#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which
Constructor Details
#initialize(options) ⇒ List
Returns a new instance of List.
9 10 11 |
# File 'lib/rly/commands/list.rb', line 9 def initialize() @options = end |
Instance Method Details
#execute(input: $stdin, output: $stdout) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rly/commands/list.rb', line 13 def execute(input: $stdin, output: $stdout) shortcuts = Rly::Shortcuts.new if shortcuts.all.empty? output.puts "no shortcuts added yet for current directory (#{Dir.pwd})" else shortcuts.all.each do |name, url| output.puts "#{name} => #{url}\n" end end end |