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
27 28 29 |
# File 'lib/mireru/command/mireru.rb', line 27 def run(*arguments) new.run(arguments) end |
Instance Method Details
#run(arguments) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/mireru/command/mireru.rb', line 36 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 |