Class: QMK::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CLI

Returns a new instance of CLI.



21
22
23
24
25
26
27
# File 'lib/cli.rb', line 21

def initialize(args)
  @options = parser(args)
  command, keyboard = args
  @firmware = Firmware.new(keyboard, @options[:keymap], config)

  command and self.send(parse_command(command))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object (private)



108
109
110
# File 'lib/cli.rb', line 108

def method_missing(*args)
  puts @options[:help]
end

Instance Method Details

#buildObject



38
39
40
# File 'lib/cli.rb', line 38

def build
  @firmware.make
end

#cleanObject



46
47
48
# File 'lib/cli.rb', line 46

def clean
  @firmware.make 'clean'
end

#flashObject



42
43
44
# File 'lib/cli.rb', line 42

def flash
  @firmware.make @firmware.programmer
end

#keyboardsObject



50
51
52
# File 'lib/cli.rb', line 50

def keyboards
  puts @firmware.keyboards
end

#setupObject



29
30
31
# File 'lib/cli.rb', line 29

def setup
  @firmware.setup
end

#updateObject



33
34
35
36
# File 'lib/cli.rb', line 33

def update
  @firmware.update
  @firmware.update_submodules
end