Fixing Exceptions and Exception-Handling
This commit is contained in:
parent
ad6f53bab3
commit
cae3692008
|
@ -120,7 +120,7 @@ class DenCli::Interactive
|
||||||
return nil if line.nil?
|
return nil if line.nil?
|
||||||
begin
|
begin
|
||||||
cur.call *line
|
cur.call *line
|
||||||
rescue ::UsageError
|
rescue ::DenCli::UsageError
|
||||||
STDERR.puts "! #$!"
|
STDERR.puts "! #$!"
|
||||||
end
|
end
|
||||||
true
|
true
|
||||||
|
|
|
@ -22,7 +22,7 @@ class DenCli::Sub
|
||||||
elsif @aliases.has_key? n
|
elsif @aliases.has_key? n
|
||||||
@aliases[n].help *a
|
@aliases[n].help *a
|
||||||
else
|
else
|
||||||
raise UnknownCommand, "unknown command: #{_full_cmd( [n])[1..-1].join ' '}, available for #{full_cmd[1..-1].join' '}: #{@subs.keys.join ' '}"
|
raise DenCli::UnknownCommand, "unknown command: #{_full_cmd( [n])[1..-1].join ' '}, available for #{full_cmd[1..-1].join' '}: #{@subs.keys.join ' '}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ class DenCli::Sub
|
||||||
if @aliases.has_key? n
|
if @aliases.has_key? n
|
||||||
@aliases[n].call *a
|
@aliases[n].call *a
|
||||||
else
|
else
|
||||||
raise UnknownCommand, "unknown command: #{_full_cmd( [n])[1..-1].join ' '}, available for #{full_cmd[1..-1].join' '}: #{@subs.keys.join ' '}"
|
raise DenCli::UnknownCommand, "unknown command: #{_full_cmd( [n])[1..-1].join ' '}, available for #{full_cmd[1..-1].join' '}: #{@subs.keys.join ' '}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
class DenCli
|
class DenCli
|
||||||
VERSION = '0.2.0'
|
VERSION = '0.2.1'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue