Class: Add

Inherits:
Command show all
Defined in:
lib/commands/add.rb

Overview

Command ‘lookfile add’ implementation

Class Method Summary collapse

Methods inherited from Command

childrens, childrens?, run_childrens, usage, usage_bottom, usage_header

Class Method Details

.command_nameObject


14
15
16
# File 'lib/commands/add.rb', line 14

def self.command_name
  'add'
end

.options_messagesObject


8
9
10
11
12
# File 'lib/commands/add.rb', line 8

def self.options_messages
  %(  add \t\t $ lookfile add [file 0] [file 1] ... [file n]
\t\t - Add files to lookfile
  )
end

.parentObject


18
19
20
# File 'lib/commands/add.rb', line 18

def self.parent
  Look
end

.run(argv) ⇒ Object


22
23
24
25
26
27
# File 'lib/commands/add.rb', line 22

def self.run(argv)
  added_files, error_files = Lookfile.add_files(argv)
  puts Lookfile.show_files('Added files:', added_files)
  puts Lookfile.show_files('Error to add files, check if exists:',
                           error_files)
end