Lines Matching refs:option

19 # Foundation; either version 2 of the License, or (at your option) any
219 # Indices in option control info.
249 my @optionlist = @_; # local copy of the option descriptions
250 my $argend = '--'; # option list terminator
251 my %opctl = (); # table of option specs
257 my $opt; # current option
295 # See if the first element of the optionlist contains option
297 # Be careful not to interpret '<>' as option starters.
336 # Parse option spec.
392 $error .= "Invalid option linkage for \"$opt\"\n";
456 # Double dash is option list terminator.
466 my $arg; # option argument
612 # Not an option. Save it if we $PERMUTE and don't have a <>.
639 "(not an option, may permute)\n") if $debug;
681 # Parse an option specification and fill the tables.
685 # Match option spec.
704 return (undef, "Error in option spec: \"$opt\"\n");
762 $dups .= "Duplicate specification \"$opt\" for option \"$_\"\n";
788 # returns (1, undef) if option in error,
806 # If it is a long option, it may include the value.
813 print STDERR ("=> option \"", $opt,
819 my $tryopt = $opt; # option to try
834 # Unbundle single letter option.
846 # Sort the possible long option names.
851 # Turn option name into pattern.
853 # Look up in option names.
860 # See if all matches are for the same option.
887 # Complete the option name, if appropriate.
891 print STDERR ("=> option \"$opt\" -> \"$tryopt\"\n")
910 warn ("Unknown option: ", $opt, "\n");
921 # If it is an option w/o argument, we're almost finished with it.
947 # Check if there is an option argument available.
953 # Check if there is an option argument available.
957 # Complain if this option needs an argument.
979 # Get key if this is a "name=value" pair for a hash option.
994 #### Check if the argument is valid for this option ####
1007 # Check for option or option list terminator.
1042 warn ("Value \"", $arg, "\" invalid for option ",
1083 warn ("Value \"", $arg, "\" invalid for option ",
1264 # If called by direct binding to an option, it will get the option
1337 program to work, hence the name 'option', but are used to modify its
1339 but with a suitable option it could provide verbose information about
1351 Options can have values, the value is placed after the option
1360 to precede the option name. Early implementations of long options used
1361 a plus C<+> instead. Also, option values could be specified either
1392 even for long option names. Also, options may be placed between
1393 non-option arguments. See L<Configuring Getopt::Long> for more
1399 presence on the command line enables the option. Popular examples are:
1405 my $verbose = ''; # option variable with default value (false)
1406 my $all = ''; # option variable with default value (false)
1410 present in C<@ARGV> and sets the option variable to the value C<1> if
1411 the option did occur on the command line. Otherwise, the option
1412 variable is not touched. Setting the option value to true is often
1413 called I<enabling> the option.
1415 The option name as specified to the GetOptions() function is called
1416 the option I<specification>. Later we'll see that this specification
1417 can contain more than just the option name. The reference to the
1418 variable is called the option I<destination>.
1429 A negatable option is specified with an exclamation mark C<!> after the
1430 option name:
1432 my $verbose = ''; # option variable with default value (false)
1441 An incremental option is specified with a plus C<+> after the
1442 option name:
1444 my $verbose = ''; # option variable with default value (false)
1449 option occurred on the command line. For example, each occurrence of
1452 =head2 Mixing command line option with other arguments
1464 In this example, C<--all> will I<not> be treated as an option, but
1469 For options that take values it must be specified whether the option
1470 value is required or not, and what kind of value the option expects.
1475 If the option value is required, Getopt::Long will take the
1476 command line argument that follows the option and assign this to the
1477 option variable. If, however, the option value is specified as
1479 valid command line option itself.
1481 my $tag = ''; # option variable with default value
1484 In the option specification, the option name is followed by an equals
1486 option requires a value. The letter C<s> indicates that this value is
1489 of the equals sign indicates that the option value is optional. In
1501 destination for the option:
1505 Alternatively, you can specify that the option can have multiple
1528 If the option destination is a reference to a hash, the option will
1550 an option is encountered on the command line can be achieved by
1552 as the option destination. When GetOptions() encounters the option, it
1554 argument is the name of the option. For a scalar or array destination,
1563 my $verbose = ''; # option variable with default value (false)
1584 C<--length>. Alternate names can be included in the option
1598 option names, and allow the options to be abbreviated to uniqueness.
1602 This call will allow C<--l> and C<--L> for the length option, but
1607 Each option specifier consists of two parts: the name specification
1610 The name specification contains the name of the option, optionally
1614 length option name is "length"
1617 The argument specification is optional. If omitted, the option is
1618 considered boolean, a value of 1 will be assigned when the option is
1627 The option does not take an argument and may be negated, i.e. prefixed
1630 option has aliases, this applies to the aliases as well.
1632 Using negation on a single letter option when bundling is in effect is
1637 The option does not take an argument and will be incremented by 1
1642 The C<+> specifier is ignored if the option destination is not a scalar.
1646 The option requires an argument of the given type. Supported types
1676 The I<desttype> can be C<@> or C<%> to specify that the option is
1678 the option value is not otherwise specified. It should be omitted when
1688 considered an option on itself.
1697 option will be incremented.
1782 argument> to GetOptions(). For each option that is specified on the
1783 command line, the option value will be stored in the hash with the
1784 option name as key. Options that are not actually used on the command
1786 C<exists($h{option})> (or defined()) can be used to test if an option
1788 runs under C<use strict> and uses C<$h{option}> without testing with
1820 if ( exists $h{filter} ) { ... option 'filter' was specified ... }
1856 Now, C<-vax> would set the option C<vax>.
1858 When any level of bundling is enabled, option values may be inserted
1879 an option. Option processing will terminate (unless "permute" is
1883 achieved by adding an option specification with an empty name, for
1888 A lone dash on the command line will now be a legal option, and using
1893 A special option 'name' C<< <> >> can be used to designate a subroutine
1894 to handle non-option arguments. When GetOptions() encounters an
1895 argument that does not look like an option, it will immediately call this
1913 This feature requires configuration option B<permute>, see section
1920 strings, each specifying a configuration option to be enabled, e.g.
1935 This option causes all configuration options to be reset to their
1940 This option causes all configuration options to be reset to their
1946 Allow option names to be abbreviated to uniqueness.
1960 C<--opt=> will give option C<opt> and empty value.
2002 terminates when the first non-option is encountered.
2011 at the first unrecognized option, or non-option, whichever comes
2016 Enabling this option will allow single-character options to be
2017 bundled. To distinguish bundles from long option names, long options
2021 auto_abbrev enabled, possible arguments and option settings are:
2023 using argument sets option(s)
2030 The suprising part is that C<--a> sets option C<a> (due to auto
2038 C<bundling> but now long option names override option bundles.
2042 B<Note:> Using option bundling can easily lead to unexpected results,
2047 If enabled, case is ignored when matching long option names. If,
2051 With C<ignore_case>, option specifications for options that only
2066 Automatically provide support for the B<--version> option if
2067 the application did not specify a handler for this option itself.
2081 the application did not specify a handler for this option itself.
2093 Options that are unknown, ambiguous or supplied with an invalid option
2100 the first unrecognized option, or non-option, whichever comes first.
2177 You cannot tie this routine directly to an option, e.g.:
2190 directly to an option, e.g.:
2202 Configuration errors and errors in the option definitions are
2209 option parsing. These errors are signalled using warn() and can be
2224 When no destination is specified for an option, GetOptions will store
2226 I<XXX> is the primary name of this option. When a progam executes
2248 =head2 Alternative option starters
2250 A string of alternative option starter characters may be passed as the
2264 GetOptions() will not interpret a leading C<< "<>" >> as option starters
2266 option starters, use C<< "><" >>. Confusing? Well, B<using a starter
2278 =head2 GetOptions does not return a false result when an option is not supplied
2313 =head2 How do I put a "-?" option into a Getopt::Long?
2331 Foundation; either version 2 of the License, or (at your option) any