22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/mireru2/command/mireru2.rb', line 22
def run(arguments)
if /\A(-h|--help)\z/ =~ arguments[0]
write_help_message
exit(true)
elsif /\A(-v|--version)\z/ =~ arguments[0]
write_version_message
exit(true)
end
font = purge_option(arguments, /\A(-f|--font)\z/, true)
files = files_from_arguments(arguments)
file_container = ::Mireru2::Container.new(files)
if file_container.empty?
write_empty_message
exit(false)
end
window = ::Mireru2::Window.new
window.font = font if font
window.add_container(file_container)
Gtk.main
end
|