Class: Mireru::Command::Mireru
- Inherits:
-
Object
- Object
- Mireru::Command::Mireru
- Defined in:
- lib/mireru/command/mireru.rb
Constant Summary collapse
- USAGE =
"Usage: mireru [OPTION]... [FILE_OR_DIRECTORY]..."
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Mireru
constructor
A new instance of Mireru.
- #run(arguments) ⇒ Object
Constructor Details
Class Method Details
.run(*arguments) ⇒ Object
11 12 13 |
# File 'lib/mireru/command/mireru.rb', line 11 def run(*arguments) new.run(arguments) end |
Instance Method Details
#run(arguments) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mireru/command/mireru.rb', line 20 def run(arguments) if /\A(-h|--help)\z/ =~ arguments[0] exit(true) elsif /\A(-v|--version)\z/ =~ arguments[0] exit(true) end font = purge_option(arguments, /\A(-f|--font)\z/, true) files = files_from_arguments(arguments) window = ::Mireru::Window.new(files) window.font = font if font window.run end |