Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.37
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby33 /
share /
ri /
system /
GetoptLong /
Delete
Unzip
Name
Size
Permission
Date
Action
AmbiguousOption
[ DIR ]
drwxr-xr-x
2026-05-05 23:08
Error
[ DIR ]
drwxr-xr-x
2026-05-05 23:08
InvalidOption
[ DIR ]
drwxr-xr-x
2026-05-05 23:08
MissingArgument
[ DIR ]
drwxr-xr-x
2026-05-05 23:08
NeedlessArgument
[ DIR ]
drwxr-xr-x
2026-05-05 23:08
cdesc-GetoptLong.ri
15.14
KB
-rw-r--r--
2026-04-07 17:22
each-i.ri
1.45
KB
-rw-r--r--
2026-04-07 17:22
each_option-i.ri
264
B
-rw-r--r--
2026-04-07 17:22
error%3f-i.ri
310
B
-rw-r--r--
2026-04-07 17:22
error-i.ri
308
B
-rw-r--r--
2026-04-07 17:22
error_message-i.ri
400
B
-rw-r--r--
2026-04-07 17:22
get-i.ri
640
B
-rw-r--r--
2026-04-07 17:22
get_option-i.ri
261
B
-rw-r--r--
2026-04-07 17:22
new-c.ri
1.01
KB
-rw-r--r--
2026-04-07 17:22
ordering%3d-i.ri
1.05
KB
-rw-r--r--
2026-04-07 17:22
ordering-i.ri
298
B
-rw-r--r--
2026-04-07 17:22
quiet%3f-i.ri
579
B
-rw-r--r--
2026-04-07 17:22
quiet-i.ri
577
B
-rw-r--r--
2026-04-07 17:22
set_error-i.ri
331
B
-rw-r--r--
2026-04-07 17:22
set_options-i.ri
530
B
-rw-r--r--
2026-04-07 17:22
terminate-i.ri
403
B
-rw-r--r--
2026-04-07 17:22
terminated%3f-i.ri
357
B
-rw-r--r--
2026-04-07 17:22
Save
Rename
U:RDoc::NormalClass[iI"GetoptLong:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[�o:RDoc::Markup::Paragraph;[I":\Class \GetoptLong provides parsing both for options ;TI"and for regular arguments.;To:RDoc::Markup::BlankLine o; ;[I"AUsing \GetoptLong, you can define options for your program. ;TI"BThe program can then capture and respond to whatever options ;TI";are included in the command that executes the program.;T@o; ;[I"/A simple example: file <tt>simple.rb</tt>:;T@o:RDoc::Markup::Verbatim;[I"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI": ['--number', '-n', GetoptLong::REQUIRED_ARGUMENT], ;TI"; ['--verbose', '-v', GetoptLong::OPTIONAL_ARGUMENT], ;TI"1 ['--help', '-h', GetoptLong::NO_ARGUMENT] ;TI") ;T:@format0o; ;[I"0If you are somewhat familiar with options, ;TI""you may want to skip to this ;TI":{full example}[#class-GetoptLong-label-Full+Example].;T@S:RDoc::Markup::Heading: leveli: textI"Options;T@o; ;[I"A \GetoptLong option has:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"#A string <em>option name</em>.;To;;0;[o; ;[I"7Zero or more string <em>aliases</em> for the name.;To;;0;[o; ;[I"An <em>option type</em>.;T@o; ;[ I"HOptions may be defined by calling singleton method GetoptLong.new, ;TI"-which returns a new \GetoptLong object. ;TI"<Options may then be processed by calling other methods ;TI"such as GetoptLong#each.;T@S; ;i;I"Option Name and Aliases;T@o; ;[I"*In the array that defines an option, ;TI"2the first element is the string option name. ;TI"FOften the name takes the 'long' form, beginning with two hyphens.;T@o; ;[I"5The option name may have any number of aliases, ;TI"5which are defined by additional string elements.;T@o; ;[I"9The name and each alias must be of one of two forms:;T@o;;;;[o;;0;[o; ;[I"2Two hyphens, followed by one or more letters.;To;;0;[o; ;[I"-One hyphen, followed by a single letter.;T@o; ;[I"File <tt>aliases.rb</tt>:;T@o;;[ I"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI"E ['--xxx', '-x', '--aaa', '-a', '-p', GetoptLong::NO_ARGUMENT] ;TI") ;TI"(options.each do |option, argument| ;TI" p [option, argument] ;TI" end ;T;0o; ;[I")An option may be cited by its name, ;TI"or by any of its aliases; ;TI"=the parsed option always reports the name, not an alias:;T@o;;[I",$ ruby aliases.rb -a -p --xxx --aaa -x ;T;0o; ;[I"Output:;T@o;;[ I"["--xxx", ""] ;TI"["--xxx", ""] ;TI"["--xxx", ""] ;TI"["--xxx", ""] ;TI"["--xxx", ""] ;T;0o; ;[I"NAn option may also be cited by an abbreviation of its name or any alias, ;TI">as long as that abbreviation is unique among the options.;T@o; ;[I"File <tt>abbrev.rb</tt>:;T@o;;[I"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI"+ ['--xxx', GetoptLong::NO_ARGUMENT], ;TI"* ['--xyz', GetoptLong::NO_ARGUMENT] ;TI") ;TI"(options.each do |option, argument| ;TI" p [option, argument] ;TI" end ;T;0o; ;[I"Command line:;T@o;;[I",$ ruby abbrev.rb --xxx --xx --xyz --xy ;T;0o; ;[I"Output:;T@o;;[ I"["--xxx", ""] ;TI"["--xxx", ""] ;TI"["--xyz", ""] ;TI"["--xyz", ""] ;T;0o; ;[I":This command line raises GetoptLong::AmbiguousOption:;T@o;;[I"$ ruby abbrev.rb --x ;T;0S; ;i;I"Repetition;T@o; ;[I"+An option may be cited more than once:;T@o;;[I".$ ruby abbrev.rb --xxx --xyz --xxx --xyz ;T;0o; ;[I"Output:;T@o;;[ I"["--xxx", ""] ;TI"["--xyz", ""] ;TI"["--xxx", ""] ;TI"["--xyz", ""] ;T;0S; ;i;I",Treating Remaining Options as Arguments;T@o; ;[I"&A option-like token that appears ;TI"Nanywhere after the token <tt>--</tt> is treated as an ordinary argument, ;TI"'and is not processed as an option:;T@o;;[I"1$ ruby abbrev.rb --xxx --xyz -- --xxx --xyz ;T;0o; ;[I"Output:;T@o;;[I"["--xxx", ""] ;TI"["--xyz", ""] ;T;0S; ;i;I"Option Types;T@o; ;[I"5Each option definition includes an option type, ;TI"9which controls whether the option takes an argument.;T@o; ;[I"File <tt>types.rb</tt>:;T@o;;[I"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI"1 ['--xxx', GetoptLong::REQUIRED_ARGUMENT], ;TI"1 ['--yyy', GetoptLong::OPTIONAL_ARGUMENT], ;TI"* ['--zzz', GetoptLong::NO_ARGUMENT] ;TI") ;TI"(options.each do |option, argument| ;TI" p [option, argument] ;TI" end ;T;0o; ;[I"JNote that an option type has to do with the <em>option argument</em> ;TI"7(whether it is required, optional, or forbidden), ;TI"4not with whether the option itself is required.;T@S; ;i ;I""Option with Required Argument;T@o; ;[I">An option of type <tt>GetoptLong::REQUIRED_ARGUMENT</tt> ;TI"Kmust be followed by an argument, which is associated with that option:;T@o;;[I"$ ruby types.rb --xxx foo ;T;0o; ;[I"Output:;T@o;;[I"["--xxx", "foo"] ;T;0o; ;[I"DIf the option is not last, its argument is whatever follows it ;TI"6(even if the argument looks like another option):;T@o;;[I"!$ ruby types.rb --xxx --yyy ;T;0o; ;[I"Output:;T@o;;[I"["--xxx", "--yyy"] ;T;0o; ;[I"3If the option is last, an exception is raised:;T@o;;[I"$ ruby types.rb ;TI"*# Raises GetoptLong::MissingArgument ;T;0S; ;i ;I""Option with Optional Argument;T@o; ;[I">An option of type <tt>GetoptLong::OPTIONAL_ARGUMENT</tt> ;TI"Smay be followed by an argument, which if given is associated with that option.;T@o; ;[I"9If the option is last, it does not have an argument:;T@o;;[I"$ ruby types.rb --yyy ;T;0o; ;[I"Output:;T@o;;[I"["--yyy", ""] ;T;0o; ;[I"OIf the option is followed by another option, it does not have an argument:;T@o;;[I"!$ ruby types.rb --yyy --zzz ;T;0o; ;[I"Output:;T@o;;[I"["--yyy", ""] ;TI"["--zzz", ""] ;T;0o; ;[I"KOtherwise the option is followed by its argument, which is associated ;TI"with that option:;T@o;;[I"$ ruby types.rb --yyy foo ;T;0o; ;[I"Output:;T@o;;[I"["--yyy", "foo"] ;T;0S; ;i ;I"Option with No Argument;T@o; ;[I"JAn option of type <tt>GetoptLong::NO_ARGUMENT</tt> takes no argument:;T@o;;[I"ruby types.rb --zzz foo ;T;0o; ;[I"Output:;T@o;;[I"["--zzz", ""] ;T;0S; ;i;I" ARGV;T@o; ;[I"CYou can process options either with method #each and a block, ;TI"or with method #get.;T@o; ;[ I"NDuring processing, each found option is removed, along with its argument ;TI"if there is one. ;TI"DAfter processing, each remaining element was neither an option ;TI"$nor the argument for an option.;T@o; ;[I"File <tt>argv.rb</tt>:;T@o;;[I"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI"1 ['--xxx', GetoptLong::REQUIRED_ARGUMENT], ;TI"1 ['--yyy', GetoptLong::OPTIONAL_ARGUMENT], ;TI"* ['--zzz', GetoptLong::NO_ARGUMENT] ;TI") ;TI"#puts "Original ARGV: #{ARGV}" ;TI"(options.each do |option, argument| ;TI" p [option, argument] ;TI" end ;TI"$puts "Remaining ARGV: #{ARGV}" ;T;0o; ;[I"Command line:;T@o;;[I":$ ruby argv.rb --xxx Foo --yyy Bar Baz --zzz Bat Bam ;T;0o; ;[I"Output:;T@o;;[ I"SOriginal ARGV: ["--xxx", "Foo", "--yyy", "Bar", "Baz", "--zzz", "Bat", "Bam"] ;TI"["--xxx", "Foo"] ;TI"["--yyy", "Bar"] ;TI"["--zzz", ""] ;TI"+Remaining ARGV: ["Baz", "Bat", "Bam"] ;T;0S; ;i;I" Ordering;T@o; ;[I"?There are three settings that control the way the options ;TI"are interpreted:;T@o;;;;[o;;0;[o; ;[I"+PERMUTE+.;To;;0;[o; ;[I"+REQUIRE_ORDER+.;To;;0;[o; ;[I"+RETURN_IN_ORDER+.;T@o; ;[I"IThe initial setting for a new \GetoptLong object is +REQUIRE_ORDER+ ;TI"Oif environment variable +POSIXLY_CORRECT+ is defined, +PERMUTE+ otherwise.;T@S; ;i ;I"PERMUTE Ordering;T@o; ;[I"?In the +PERMUTE+ ordering, options and other, non-option, ;TI"7arguments may appear in any order and any mixture.;T@o; ;[I"File <tt>permute.rb</tt>:;T@o;;[I"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI"1 ['--xxx', GetoptLong::REQUIRED_ARGUMENT], ;TI"1 ['--yyy', GetoptLong::OPTIONAL_ARGUMENT], ;TI"* ['--zzz', GetoptLong::NO_ARGUMENT] ;TI") ;TI"#puts "Original ARGV: #{ARGV}" ;TI"(options.each do |option, argument| ;TI" p [option, argument] ;TI" end ;TI"$puts "Remaining ARGV: #{ARGV}" ;T;0o; ;[I"Command line:;T@o;;[I"K$ ruby permute.rb Foo --zzz Bar --xxx Baz --yyy Bat Bam --xxx Bag Bah ;T;0o; ;[I"Output:;T@o;;[I"jOriginal ARGV: ["Foo", "--zzz", "Bar", "--xxx", "Baz", "--yyy", "Bat", "Bam", "--xxx", "Bag", "Bah"] ;TI"["--zzz", ""] ;TI"["--xxx", "Baz"] ;TI"["--yyy", "Bat"] ;TI"["--xxx", "Bag"] ;TI"2Remaining ARGV: ["Foo", "Bar", "Bam", "Bah"] ;T;0S; ;i ;I"REQUIRE_ORDER Ordering;T@o; ;[I"KIn the +REQUIRE_ORDER+ ordering, all options precede all non-options; ;TI"8that is, each word after the first non-option word ;TI"Gis treated as a non-option word (even if it begins with a hyphen).;T@o; ;[I"$File <tt>require_order.rb</tt>:;T@o;;[I"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI"1 ['--xxx', GetoptLong::REQUIRED_ARGUMENT], ;TI"1 ['--yyy', GetoptLong::OPTIONAL_ARGUMENT], ;TI"* ['--zzz', GetoptLong::NO_ARGUMENT] ;TI") ;TI"2options.ordering = GetoptLong::REQUIRE_ORDER ;TI"#puts "Original ARGV: #{ARGV}" ;TI"(options.each do |option, argument| ;TI" p [option, argument] ;TI" end ;TI"$puts "Remaining ARGV: #{ARGV}" ;T;0o; ;[I"Command line:;T@o;;[I"D$ ruby require_order.rb --xxx Foo Bar --xxx Baz --yyy Bat -zzz ;T;0o; ;[I"Output:;T@o;;[I"TOriginal ARGV: ["--xxx", "Foo", "Bar", "--xxx", "Baz", "--yyy", "Bat", "-zzz"] ;TI"["--xxx", "Foo"] ;TI"ERemaining ARGV: ["Bar", "--xxx", "Baz", "--yyy", "Bat", "-zzz"] ;T;0S; ;i ;I"RETURN_IN_ORDER Ordering;T@o; ;[ I"LIn the +RETURN_IN_ORDER+ ordering, every word is treated as an option. ;TI"LA word that begins with a hyphen (or two) is treated in the usual way; ;TI"Ba word +word+ that does not so begin is treated as an option ;TI">whose name is an empty string, and whose value is +word+.;T@o; ;[I"&File <tt>return_in_order.rb</tt>:;T@o;;[I"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI"1 ['--xxx', GetoptLong::REQUIRED_ARGUMENT], ;TI"1 ['--yyy', GetoptLong::OPTIONAL_ARGUMENT], ;TI"* ['--zzz', GetoptLong::NO_ARGUMENT] ;TI") ;TI"4options.ordering = GetoptLong::RETURN_IN_ORDER ;TI"#puts "Original ARGV: #{ARGV}" ;TI"(options.each do |option, argument| ;TI" p [option, argument] ;TI" end ;TI"$puts "Remaining ARGV: #{ARGV}" ;T;0o; ;[I"Command line:;T@o;;[I"?$ ruby return_in_order.rb Foo --xxx Bar Baz --zzz Bat Bam ;T;0o; ;[I"Output:;T@o;;[ I"JOriginal ARGV: ["Foo", "--xxx", "Bar", "Baz", "--zzz", "Bat", "Bam"] ;TI"["", "Foo"] ;TI"["--xxx", "Bar"] ;TI"["", "Baz"] ;TI"["--zzz", ""] ;TI"["", "Bat"] ;TI"["", "Bam"] ;TI"Remaining ARGV: [] ;T;0S; ;i;I"Full Example;T@o; ;[I" File <tt>fibonacci.rb</tt>:;T@o;;[CI"require 'getoptlong' ;TI" ;TI"options = GetoptLong.new( ;TI": ['--number', '-n', GetoptLong::REQUIRED_ARGUMENT], ;TI"; ['--verbose', '-v', GetoptLong::OPTIONAL_ARGUMENT], ;TI"1 ['--help', '-h', GetoptLong::NO_ARGUMENT] ;TI") ;TI" ;TI"def help(status = 0) ;TI" puts <<~HELP ;TI" Usage: ;TI" ;TI" -n n, --number n: ;TI"- Compute Fibonacci number for n. ;TI". -v [boolean], --verbose [boolean]: ;TI"< Show intermediate results; default is 'false'. ;TI" -h, --help: ;TI" Show this help. ;TI" HELP ;TI" exit(status) ;TI" end ;TI" ;TI""def print_fibonacci (number) ;TI" return 0 if number == 0 ;TI". return 1 if number == 1 or number == 2 ;TI" i = 0 ;TI" j = 1 ;TI" (2..number).each do ;TI" k = i + j ;TI" i = j ;TI" j = k ;TI" puts j if @verbose ;TI" end ;TI" puts j unless @verbose ;TI" end ;TI" ;TI"(options.each do |option, argument| ;TI" case option ;TI" when '--number' ;TI"! @number = argument.to_i ;TI" when '--verbose' ;TI"' @verbose = if argument.empty? ;TI" true ;TI"' elsif argument.match(/true/i) ;TI" true ;TI"( elsif argument.match(/false/i) ;TI" false ;TI" else ;TI"; puts '--verbose argument must be true or false' ;TI" help(255) ;TI" end ;TI" when '--help' ;TI" help ;TI" end ;TI" end ;TI" ;TI"unless @number ;TI"+ puts 'Option --number is required.' ;TI" help(255) ;TI" end ;TI" ;TI"print_fibonacci(@number) ;T;0o; ;[I"Command line:;T@o;;[I"$ ruby fibonacci.rb ;T;0o; ;[I"Output:;T@o;;[I""Option --number is required. ;TI"Usage: ;TI" ;TI" -n n, --number n: ;TI") Compute Fibonacci number for n. ;TI"* -v [boolean], --verbose [boolean]: ;TI"8 Show intermediate results; default is 'false'. ;TI" -h, --help: ;TI" Show this help. ;T;0o; ;[I"Command line:;T@o;;[I""$ ruby fibonacci.rb --number ;T;0o; ;[I"(Raises GetoptLong::MissingArgument:;T@o;;[I":fibonacci.rb: option `--number' requires an argument ;T;0o; ;[I"Command line:;T@o;;[I"$$ ruby fibonacci.rb --number 6 ;T;0o; ;[I"Output:;T@o;;[I"8 ;T;0o; ;[I"Command line:;T@o;;[I".$ ruby fibonacci.rb --number 6 --verbose ;T;0o; ;[I"Output:;To;;[ I"1 ;TI"2 ;TI"3 ;TI"5 ;TI"8 ;T;0o; ;[I"Command line:;T@o;;[I"2$ ruby fibonacci.rb --number 6 --verbose yes ;T;0o; ;[I"Output:;T@o;;[I".--verbose argument must be true or false ;TI"Usage: ;TI" ;TI" -n n, --number n: ;TI") Compute Fibonacci number for n. ;TI"* -v [boolean], --verbose [boolean]: ;TI"8 Show intermediate results; default is 'false'. ;TI" -h, --help: ;TI" Show this help.;T;0: @fileI"lib/getoptlong.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ I" error;TI"R;T:privateFI"lib/getoptlong.rb;T[ I"error?;T@�;F@�[ I" ordering;T@�;F@�[ I" quiet;TI"RW;T;F@�[ I"quiet?;T@�;F@�[ U:RDoc::Constant[i I"VERSION;TI"GetoptLong::VERSION;T:public0o;;[o; ;[I" Version.;T;@�;0@�@cRDoc::NormalClass0U;[i I"ORDERINGS;TI"GetoptLong::ORDERINGS;T;0o;;[o; ;[I"Orderings.;T;@�;0@�@@�0U;[i I"ARGUMENT_FLAGS;TI"GetoptLong::ARGUMENT_FLAGS;T;0o;;[o; ;[I"Argument flags.;T;@�;0@�@@�0U;[i I"STATUS_TERMINATED;TI""GetoptLong::STATUS_TERMINATED;T;0o;;[ ;@�;0@�@@�0[ [[I" class;T[[;[ [:protected[ [;[[I"new;T@�[I" instance;T[[;[ [;[ [;[[I" each;T@�[I"each_option;T@�[I"error_message;T@�[I"get;T@�[I"get_option;T@�[I"ordering=;T@�[I"set_error;T@�[I"set_options;T@�[I"terminate;T@�[I"terminated?;T@�[ [U:RDoc::Context::Section[i 0o;;[ ;0;0[I"lib/getoptlong.rb;T@�cRDoc::TopLevel