Class: QMK::CLI
- Inherits:
-
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
108
109
110
|
# File 'lib/cli.rb', line 108
def method_missing(*args)
puts @options[:help]
end
|
Instance Method Details
#build ⇒ Object
38
39
40
|
# File 'lib/cli.rb', line 38
def build
@firmware.make
end
|
#clean ⇒ Object
46
47
48
|
# File 'lib/cli.rb', line 46
def clean
@firmware.make 'clean'
end
|
#flash ⇒ Object
42
43
44
|
# File 'lib/cli.rb', line 42
def flash
@firmware.make @firmware.programmer
end
|
#keyboards ⇒ Object
50
51
52
|
# File 'lib/cli.rb', line 50
def keyboards
puts @firmware.keyboards
end
|
#setup ⇒ Object
29
30
31
|
# File 'lib/cli.rb', line 29
def setup
@firmware.setup
end
|
#update ⇒ Object
33
34
35
36
|
# File 'lib/cli.rb', line 33
def update
@firmware.update
@firmware.update_submodules
end
|