ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- PKq]WMset_options-i.rinu[U:RDoc::AnyMethod[iI"set_options:EFI"GetoptLong#set_options;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"REQUIRE_ORDER :;T@o; ; [I"6Options are required to occur before non-options.;T@o; ; [I"NProcessing of options ends as soon as a word is encountered that has not ;TI"1been preceded by an appropriate option flag.;T@o; ; [ I"HFor example, if -a and -b are options which do not take arguments, ;TI"Gparsing command line arguments of '-a one -b two' would result in ;TI"F'one', '-b', 'two' being left in ARGV, and only ('-a', '') being ;TI"%processed as an option/arg pair.;T@o; ; [I"?This is the default ordering, if the environment variable ;TI"NPOSIXLY_CORRECT is set. (This is for compatibility with GNU getopt_long.);T@o; ; [I"PERMUTE :;T@o; ; [I"HOptions can occur anywhere in the command line parsed. This is the ;TI"default behavior.;T@o; ; [I"LEvery sequence of words which can be interpreted as an option (with or ;TI"Mwithout argument) is treated as an option; non-option words are skipped.;T@o; ; [ I"MFor example, if -a does not require an argument and -b optionally takes ;TI"Nan argument, parsing '-a one -b two three' would result in ('-a','') and ;TI"J('-b', 'two') being processed as option/arg pairs, and 'one','three' ;TI"being left in ARGV.;T@o; ; [I"DIf the ordering is set to PERMUTE but the environment variable ;TI"HPOSIXLY_CORRECT is set, REQUIRE_ORDER is used instead. This is for ;TI"(compatibility with GNU getopt_long.;T@o; ; [I"RETURN_IN_ORDER :;T@o; ; [I"GAll words on the command line are processed as options. Words not ;TI"Epreceded by a short or long option flag are passed as arguments ;TI")with an option of '' (empty string).;T@o; ; [I"MFor example, if -a requires an argument but -b does not, a command line ;TI"Pof '-a one -b two three' would result in option/arg pairs of ('-a', 'one') ;TI"<('-b', ''), ('', 'two'), ('', 'three') being processed.;T: @fileI"lib/getoptlong.rb;T:0@omit_headings_from_table_of_contents_below000[I"(ordering);T@KFI"GetoptLong;TcRDoc::NormalClass00PKq]4=55 error-i.rinu[U:RDoc::Attr[iI" error:ETI"GetoptLong#error;TI"R;T: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"4Examine whether an option processing is failed.;T: @fileI"lib/getoptlong.rb;T:0@omit_headings_from_table_of_contents_below0F@I"GetoptLong;TcRDoc::NormalClass0PKq][ LLset_error-i.rinu[U:RDoc::AnyMethod[iI"set_error:EFI"GetoptLong#set_error;TF:protectedo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"'Set an error (a protected method).;T: @fileI"lib/getoptlong.rb;T:0@omit_headings_from_table_of_contents_below000[I"(type, message);T@FI"GetoptLong;TcRDoc::NormalClass00PKq]Rύerror_message-i.rinu[U:RDoc::AnyMethod[iI"error_message:EFI"GetoptLong#error_message;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"CReturn the appropriate error message in POSIX-defined format. ;TI"+If no error has occurred, returns nil.;T: @fileI"lib/getoptlong.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"GetoptLong;TcRDoc::NormalClass00PKq]S  cdesc-GetoptLong.rinu[U:RDoc::NormalClass[iI"GetoptLong:ET@I" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"PThe GetoptLong class allows you to parse command line options similarly to ;TI"Othe GNU getopt_long() C library call. Note, however, that GetoptLong is a ;TI"pure Ruby implementation.;To:RDoc::Markup::BlankLineo; ;[I"LGetoptLong allows for POSIX-style options like --file as well ;TI".as single letter options like -f;T@o; ;[I"LThe empty option -- (two minus symbols) is used to end option ;TI"Mprocessing. This can be particularly important if options have optional ;TI"arguments.;T@o; ;[I"'Here is a simple example of usage:;T@o:RDoc::Markup::Verbatim;[;I"require 'getoptlong' ;TI" ;TI"opts = GetoptLong.new( ;TI"4 [ '--help', '-h', GetoptLong::NO_ARGUMENT ], ;TI"< [ '--repeat', '-n', GetoptLong::REQUIRED_ARGUMENT ], ;TI"3 [ '--name', GetoptLong::OPTIONAL_ARGUMENT ] ;TI") ;TI" ;TI"dir = nil ;TI"name = nil ;TI"repetitions = 1 ;TI"opts.each do |opt, arg| ;TI" case opt ;TI" when '--help' ;TI" puts <<-EOF ;TI"hello [OPTION] ... DIR ;TI" ;TI"-h, --help: ;TI" show help ;TI" ;TI"--repeat x, -n x: ;TI" repeat x times ;TI" ;TI"--name [name]: ;TI"A greet user by name, if name not supplied default is John ;TI" ;TI"8DIR: The directory in which to issue the greeting. ;TI" EOF ;TI" when '--repeat' ;TI"" repetitions = arg.to_i ;TI" when '--name' ;TI" if arg == '' ;TI" name = 'John' ;TI" else ;TI" name = arg ;TI" end ;TI" end ;TI" end ;TI" ;TI"if ARGV.length != 1 ;TI"0 puts "Missing dir argument (try --help)" ;TI" exit 0 ;TI" end ;TI" ;TI"dir = ARGV.shift ;TI" ;TI"Dir.chdir(dir) ;TI"for i in (1..repetitions) ;TI" print "Hello" ;TI" if name ;TI" print ", #{name}" ;TI" end ;TI" puts ;TI" end ;T: @format0o; ;[I"Example command line:;T@o; ;[I"hello -n 6 --name -- /tmp;T; 0: @fileI"lib/getoptlong.rb;T:0@omit_headings_from_table_of_contents_below0; 0;0[ [ I" error;TI"R;T: publicFI"lib/getoptlong.rb;T[ I" error?;F@a;F@b[ I" ordering;TI"R;T;F@b[ I" quiet;TI"RW;T;F@b[ I" quiet?;FI"RW;T;F@b[U:RDoc::Constant[iI"ORDERINGS;FI"GetoptLong::ORDERINGS;T00o;;[o; ;[I"Orderings.;T; @];0@]@cRDoc::NormalClass0U;[iI"ARGUMENT_FLAGS;FI"GetoptLong::ARGUMENT_FLAGS;T00o;;[o; ;[I"Argument flags.;T; @];0@]@@x0U;[iI"STATUS_TERMINATED;FI""GetoptLong::STATUS_TERMINATED;T00o;;[; @];0@]@@x0[[[I" class;T[[;[[I"new;T@b[:protected[[: private[[I" instance;T[[;[[I" each;F@b[I"each_option;F@b[I"error_message;F@b[I"get;F@b[I"get_option;F@b[I"ordering=;F@b[I"set_options;F@b[I"terminate;F@b[I"terminated?;F@b[;[[I"set_error;F@b[;[[[U:RDoc::Context::Section[i0o;;[; 0;0[@]@]cRDoc::TopLevelPKq]4N&(QQeach_option-i.rinu[U:RDoc::AnyMethod[iI"each_option:EFI"GetoptLong#each_option;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I")`each_option' is an alias of `each'.;T: @fileI"lib/getoptlong.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"GetoptLong;TcRDoc::NormalClass0[@FI" each;FPKq]y~ each-i.rinu[U:RDoc::AnyMethod[iI" each:EFI"GetoptLong#each;TF: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"Iterator version of `get'.;To:RDoc::Markup::BlankLineo; ; [ I"8The block is called repeatedly with two arguments: ;TI"#The first is the option name. ;TI"