lib/csd/options_parser.rb in csd-0.1.9 vs lib/csd/options_parser.rb in csd-0.1.10

- old
+ new

@@ -24,14 +24,14 @@ end def define_actions_and_scopes if Applications.current # Here we overwrite the default supported actions and scopes with the application specific ones - UI.debug "Loading actions of #{Applications.current}." + UI.debug "#{self.class} loads the actions of #{Applications.current} now" self.actions = Applications.current.actions # At this point we know that the first argument is no option, but *some* action (may it be valid or not) - UI.debug "Loading scopes of #{Applications.current}." + UI.debug "#{self.class} loads the scopes of #{Applications.current} now" self.scopes = Applications.current.scopes(self.action) end end def clear @@ -128,10 +128,10 @@ opts.on_tail("-h", "--help", "Show detailed help (regarding the given ACTION and APPLICATION)") do |value| self.help = value end opts.on_tail("-v", "--version", "Show the version of this AI") do puts "CSD Gem Version: #{CSD::Version}".blue - exit + raise Error::Argument::VersionWasRequested end self.helptext = opts.help end.parse! rescue OptionParser::InvalidOption => e raise Error::Argument::InvalidOption, e.message.gsub('invalid option: ', 'This option argument seems to be incorrect: ')