Class: Kikeru::Command
- Inherits:
-
Object
- Object
- Kikeru::Command
- Defined in:
- lib/kikeru/command.rb
Constant Summary collapse
- USAGE =
"Usage: kikeru [OPTION]... [FILE]..."
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Command
constructor
A new instance of Command.
- #run(arguments) ⇒ Object
Constructor Details
Class Method Details
.run(*arguments) ⇒ Object
12 13 14 |
# File 'lib/kikeru/command.rb', line 12 def run(*arguments) new.run(arguments) end |
Instance Method Details
#run(arguments) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/kikeru/command.rb', line 21 def run(arguments) if /\A(-h|--help)\z/ =~ arguments[0] exit(true) elsif /\A(-v|--version)\z/ =~ arguments[0] exit(true) end files = files_from_arguments(arguments) file_container = Kikeru::Container.new(files) if file_container.empty? exit(false) end window = Kikeru::Window.new window.add_container(file_container) window.show_all window.load Gtk.main end |