Class | Clio::Usage::Parser |
In: |
lib/clio/usage/parser.rb
|
Parent: | Object |
Parse commandline arguments according to given Usage.
argv | [R] | |
signatures | [R] | |
usage | [R] |
# File lib/clio/usage/parser.rb, line 20 def initialize(usage, argv) #, index=0) # convert to array if argv string if ::String===argv argv = Shellwords.shellwords(argv) else argv = argv.dup end @usage = usage @argv = argv @parsed = false @signatures = [] @errors = [] end
# File lib/clio/usage/parser.rb, line 41 def inspect s = "<" + signatures.inspect + ">" s #s = "#<#{self.class}" #s << " @options=#{@options.inspect}" unless @options.empty? #s << " @arguments=#{@arguments.inspect}" unless @arguments.empty? #s << " @subcommand=#{@subcommand}>" if @subcommand #s << ">" #s end