Lines Matching refs:opt
260 my $opt; # current option
316 my $opt = shift (@optionlist);
318 unless ( defined($opt) ) {
324 $opt = $+ if $opt =~ /^$prefix+(.*)$/s;
326 if ( $opt eq '<>' ) {
329 && (exists $userlinkage->{$opt})
330 && ref($userlinkage->{$opt}) ) {
331 unshift (@optionlist, $userlinkage->{$opt});
346 my ($name, $orig) = ParseOptionSpec ($opt, \%opctl);
401 $error .= "Invalid option linkage for \"$opt\"\n";
462 $opt = shift (@ARGV);
463 print STDERR ("=> arg \"", $opt, "\"\n") if $debug;
466 if ( $opt eq $argend ) {
472 my $tryopt = $opt;
478 ($found, $opt, $ctl, $arg, $key) =
479 FindOption ($prefix, $argend, $opt, \%opctl);
484 next unless defined $opt;
490 print STDERR ("=> cname for \"$opt\" is ") if $debug;
491 $opt = $ctl->[CTL_CNAME];
494 if ( defined $linkage{$opt} ) {
495 print STDERR ("=> ref(\$L{$opt}) -> ",
496 ref($linkage{$opt}), "\n") if $debug;
498 if ( ref($linkage{$opt}) eq 'SCALAR' ) {
500 print STDERR ("=> \$\$L{$opt} += \"$arg\"\n")
502 if ( defined ${$linkage{$opt}} ) {
503 ${$linkage{$opt}} += $arg;
506 ${$linkage{$opt}} = $arg;
510 print STDERR ("=> ref(\$L{$opt}) auto-vivified",
513 my $t = $linkage{$opt};
514 $$t = $linkage{$opt} = [];
515 print STDERR ("=> push(\@{\$L{$opt}, \"$arg\")\n")
517 push (@{$linkage{$opt}}, $arg);
520 print STDERR ("=> ref(\$L{$opt}) auto-vivified",
523 my $t = $linkage{$opt};
524 $$t = $linkage{$opt} = {};
525 print STDERR ("=> \$\$L{$opt}->{$key} = \"$arg\"\n")
527 $linkage{$opt}->{$key} = $arg;
530 print STDERR ("=> \$\$L{$opt} = \"$arg\"\n")
532 ${$linkage{$opt}} = $arg;
535 elsif ( ref($linkage{$opt}) eq 'ARRAY' ) {
536 print STDERR ("=> push(\@{\$L{$opt}, \"$arg\")\n")
538 push (@{$linkage{$opt}}, $arg);
540 elsif ( ref($linkage{$opt}) eq 'HASH' ) {
541 print STDERR ("=> \$\$L{$opt}->{$key} = \"$arg\"\n")
543 $linkage{$opt}->{$key} = $arg;
545 elsif ( ref($linkage{$opt}) eq 'CODE' ) {
546 print STDERR ("=> &L{$opt}(\"$opt\"",
554 &{$linkage{$opt}}($opt,
573 print STDERR ("Invalid REF type \"", ref($linkage{$opt}),
580 if ( defined $userlinkage->{$opt} ) {
581 print STDERR ("=> push(\@{\$L{$opt}}, \"$arg\")\n")
583 push (@{$userlinkage->{$opt}}, $arg);
586 print STDERR ("=>\$L{$opt} = [\"$arg\"]\n")
588 $userlinkage->{$opt} = [$arg];
592 if ( defined $userlinkage->{$opt} ) {
593 print STDERR ("=> \$L{$opt}->{$key} = \"$arg\"\n")
595 $userlinkage->{$opt}->{$key} = $arg;
598 print STDERR ("=>\$L{$opt} = {$key => \"$arg\"}\n")
600 $userlinkage->{$opt} = {$key => $arg};
605 print STDERR ("=> \$L{$opt} += \"$arg\"\n")
607 if ( defined $userlinkage->{$opt} ) {
608 $userlinkage->{$opt} += $arg;
611 $userlinkage->{$opt} = $arg;
615 print STDERR ("=>\$L{$opt} = \"$arg\"\n") if $debug;
616 $userlinkage->{$opt} = $arg;
633 warn("Value \"$ARGV[0]\" invalid for option $opt\n");
637 warn("Insufficient arguments for option $opt\n");
724 my ($opt, $opctl) = @_;
727 if ( $opt !~ m;^
745 return (undef, "Error in option spec: \"$opt\"\n");
789 return (undef, "Cannot repeat while bundling: \"$opt\"\n")
792 return (undef, "{0} is useless in option spec: \"$opt\"\n")
805 return (undef, "Max must be greater than zero in option spec: \"$opt\"\n")
807 return (undef, "Max less than min in option spec: \"$opt\"\n")
822 $dups .= "Duplicate specification \"$opt\" for option \"$_\"\n";
851 my ($prefix, $argend, $opt, $opctl) = @_;
853 print STDERR ("=> find \"$opt\"\n") if $debug;
855 return (0) unless $opt =~ /^$prefix(.*)$/s;
856 return (0) if $opt eq "-" && !defined $opctl->{''};
858 $opt = $+;
861 print STDERR ("=> split \"$starter\"+\"$opt\"\n") if $debug;
870 && $opt =~ /^([^=]+)=(.*)$/s ) {
871 $opt = $1;
873 print STDERR ("=> option \"", $opt,
879 my $tryopt = $opt; # option to try
884 $tryopt = $ignorecase ? lc($opt) : $opt;
893 $tryopt = $opt;
909 $opt = lc ($opt) if $ignorecase;
910 $tryopt = $opt;
912 my $pat = quotemeta ($opt);
919 unless ( (@hits <= 1) || (grep ($_ eq $opt, @hits) == 1) ) {
940 warn ("Option ", $opt, " is ambiguous (",
949 if ( @hits == 1 && $hits[0] ne $opt ) {
952 print STDERR ("=> option \"$opt\" -> \"$tryopt\"\n")
959 $tryopt = lc ($opt);
968 $opt = substr($opt,0,1);
971 warn ("Unknown option: ", $opt, "\n");
976 $opt = $tryopt;
978 " for \"", $opt, "\"\n") if $debug;
989 warn ("Option ", $opt, " does not take an argument\n");
991 undef $opt;
998 $opt =~ s/^no-?//i; # strip NO prefix
1002 return (1, $opt, $ctl, $arg);
1010 return (1, $opt, $ctl, $type eq 's' ? '' : 0) unless $mand;
1021 warn ("Option ", $opt, " requires an argument\n");
1029 return (1, $opt, \@c, 1);
1031 return (1, $opt, $ctl,
1047 warn ("Option $opt, key \"$key\", requires a value\n");
1061 return (1, $opt, $ctl, $arg, $key) if $mand;
1064 return (1, $opt, $ctl, $arg, $key)
1066 return (1, $opt, $ctl, $arg, $key) if $arg eq "-"; # ??
1104 $opt, " (",
1119 return (1, $opt, \@c, 1);
1145 $opt, " (real number expected)\n");
1162 return (1, $opt, $ctl, $arg, $key);
1223 my $opt;
1224 foreach $opt ( @options ) {
1225 my $try = lc ($opt);
1310 die("Getopt::Long: unknown config parameter \"$opt\"")