Class: Kuzya::Commands::Remove

Inherits:
Base
  • Object
show all
Defined in:
lib/kuzya/commands/remove.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

args_without_command, call

Constructor Details

#initialize(args, config) ⇒ Remove

Returns a new instance of Remove.



21
22
23
24
# File 'lib/kuzya/commands/remove.rb', line 21

def initialize(args, config)
  @args = args
  @config = config
end

Class Method Details

.infoObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/kuzya/commands/remove.rb', line 5

def info
<<-INFO
#{'remove'.bold} - if you want to remove shortcut you can run:
  #{'kuzya remove shortcut_name'.italic}
Also you can remove nested shortcuts, to do it run:
  #{'kuzya remove parent_shortcut child_shortcut'.italic}
Note: Removing shortcut that have nested shortcuts also removes them
  aliases: #{'rm'.italic}
INFO
end

.prepare(args, config) ⇒ Object



16
17
18
# File 'lib/kuzya/commands/remove.rb', line 16

def prepare(args, config)
  [args_without_command(args), config]
end

Instance Method Details

#callObject



26
27
28
# File 'lib/kuzya/commands/remove.rb', line 26

def call
  config.remove(args)
end