lib/args_parser/styles/equal.rb in args_parser-0.0.7 vs lib/args_parser/styles/equal.rb in args_parser-0.0.8
- old
+ new
@@ -1,9 +1,14 @@
module ArgsParser
class Parser
def parse_style_equal(argv)
+ on_validate_error do |err, name, value|
+ STDERR.puts "Error: #{err.message} (--#{name}=#{value})"
+ exit 1
+ end
+
is_option = /^-+([^-=\s]+)$/
is_param = /^-+([^-=\s]+)=([^=\s]+)$/
argv.each_with_index do |arg, i|
if arg =~ is_option
k,v = [arg.scan(is_option)[0][0], true]