lib/argy.rb in argy-0.1.0 vs lib/argy.rb in argy-0.2.0

- old
+ new

@@ -3,15 +3,23 @@ module Argy Error = Class.new(StandardError) CoersionError = Class.new(Error) ValidationError = Class.new(Error) - MissingArgumentError = Class.new(Error) + class ParseError < Error + attr_reader :original + + def initialize(original) + @original = original + super(original.message) + end + end + def self.new(&block) Argy::Parser.new(&block) end - def self.parse(argv, &block) + def self.parse(argv: ARGV, &block) new(&block).parse(argv) end end