lib/rabbit/command/rabbit.rb in rabbit-2.1.8 vs lib/rabbit/command/rabbit.rb in rabbit-2.1.9
- old
+ new
@@ -50,17 +50,20 @@
application = ::Rabbit.application
succeeded = false
application.signal_connect("command-line") do |_, command_line|
application.activate
- 0
+ succeeded ? 0 : 1
end
application.signal_connect("activate") do
- succeeded = __send__("do_#{@options.action}")
+ begin
+ succeeded = __send__("do_#{@options.action}")
+ rescue
+ @logger.error($!)
+ end
end
- application.run
- succeeded
+ application.run.zero?
end
private
def parse_command_line_arguments(arguments)
Console.parse!(arguments) do |parser, options|
@@ -442,11 +445,11 @@
parser.on("--page-margin={#{margin1}|#{margin2}|#{margin3}|#{margin4}}",
Array,
_("Set page margin.")) do |margins|
begin
- top, right, bottom, left = Utils.parse_four_dimensions(margins)
+ top, right, bottom, left = Utils.parse_four_way(margins)
options.page_margin_top = top
options.page_margin_right = right
options.page_margin_bottom = bottom
options.page_margin_left = left
rescue ArgumentError
@@ -646,9 +649,10 @@
dialog.current_folder = @options.base if @options.base
add_source_dialog_filter(dialog, "Rabbit files", "*.rab")
add_source_dialog_filter(dialog, "RD files", "*.rd")
add_source_dialog_filter(dialog, "Hiki files", "*.hiki")
add_source_dialog_filter(dialog, "PDF files", "*.pdf")
+ add_source_dialog_filter(dialog, "Markdown files", "*.md")
add_source_dialog_filter(dialog, "All files", "*")
file_name = nil
if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT
file_name = dialog.filename
dialog.destroy