Navigation Menu

Skip to content

Commit

Permalink
Don't exit by command iplementation itself
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 15, 2015
1 parent 8e5a4c2 commit 143b7bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/droonga-groonga
Expand Up @@ -58,7 +58,7 @@ module Droonga
end

true
rescue InvalidCommandName, MissingCommandName
rescue MissingRequiredParameter, InvalidCommandName, MissingCommandName
puts(@options)
true
end
Expand Down
3 changes: 3 additions & 0 deletions bin/droonga-system-status
Expand Up @@ -39,6 +39,9 @@ module Droonga
puts(JSON.generate(body))
end

true
rescue MissingRequiredParameter
puts(@options)
true
end
end
Expand Down
5 changes: 4 additions & 1 deletion lib/droonga/command/base.rb
Expand Up @@ -21,6 +21,9 @@

module Droonga
module Command
class MissingRequiredParameter < StandardError
end

class Base
private
def parse_options(&block)
Expand Down Expand Up @@ -48,7 +51,7 @@ def parse_options(&block)
@options = options
rescue Slop::MissingOptionError => error
$stderr.puts(error)
exit(false)
raise MissingRequiredParameter.new
end

def client
Expand Down

0 comments on commit 143b7bb

Please sign in to comment.