README.md in args_parser-0.1.4 vs README.md in args_parser-0.1.5

- old
+ new

@@ -1,10 +1,10 @@ args_parser =========== * Parse ARGV from command line with DSL. -* http://shokai.github.com/args_parser +* http://shokai.github.io/args_parser Requirements ------------ * Ruby 1.8.7+ @@ -27,11 +27,11 @@ parse ARGV ```ruby require 'rubygems' require 'args_parser' -parser = ArgsParser.parse ARGV do +args = ArgsParser.parse ARGV do arg :url, 'URL', :alias => :u arg :output, 'output file', :alias => :o, :default => 'out.html' arg :verbose, 'verbose mode' arg :help, 'show help', :alias => :h @@ -42,29 +42,29 @@ validate :url, "invalid URL" do |v| v =~ /^https?:\/\/.+$/ end end -if parser.has_option? :help or !parser.has_param?(:url, :output) - STDERR.puts parser.help +if args.has_option? :help or !args.has_param?(:url, :output) + STDERR.puts args.help exit 1 end require 'open-uri' -puts 'download..' if parser[:verbose] -open(parser[:output], 'w+') do |f| - f.write open(parser[:url]).read +puts 'download..' if args[:verbose] +open(args[:output], 'w+') do |f| + f.write open(args[:url]).read end -puts "saved! => #{parser[:output]}" +puts "saved! => #{args[:output]}" ``` equal style % ruby samples/twitter_timeline.rb --user=shokai --fav --rt parse equal style ARGV ```ruby -parser = ArgsParser.parse ARGV, :style => :equal do +args = ArgsArgs.parse ARGV, :style => :equal do ``` see more samples https://github.com/shokai/args_parser/tree/master/samples \ No newline at end of file