summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/slop/error.rb14
-rw-r--r--test/error_test.rb2
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/slop/error.rb b/lib/slop/error.rb
index d942bbd..74453e3 100644
--- a/lib/slop/error.rb
+++ b/lib/slop/error.rb
@@ -12,15 +12,13 @@ module Slop
# executed without one. Suppress with the `suppress_errors`
# config option.
class MissingArgument < Error
- def initialize(msg, argument)
- super(msg)
- @argument = argument
- end
+ attr_reader :flags;
- #Get all the flags that matches
- #the option with the missing argument
- def getFlags()
- return @argument
+ # Get all the flags that matches
+ # the option with the missing argument
+ def initialize(msg, flags)
+ super(msg)
+ @flags = flags
end
end
diff --git a/test/error_test.rb b/test/error_test.rb
index 1bf1604..42c4b9d 100644
--- a/test/error_test.rb
+++ b/test/error_test.rb
@@ -12,7 +12,7 @@ describe Slop::MissingArgument do
begin
opts.parse %w(--name)
rescue Slop::MissingArgument => e
- assert_equal(e.getFlags(), ["-n", "--name"])
+ assert_equal(e.flags, ["-n", "--name"])
end
end