pike.git / lib / modules / Getopt.pmod

version» Context lines:

pike.git/lib/modules/Getopt.pmod:44:   //!   //! @param envvars   //! This argument specifies an environment variable that can be used   //! to specify the same option, to make it easier to customize   //! program usage. It can also be an array of strings, in which case   //! any of the mentioned variables in the array may be used.   //!   //! @param def   //! This argument has two functions: It specifies if the option takes an   //! argument or not, and it informs @[find_option()] what to return if the - //! option is not present. If @[def] is given and the option does not have an - //! argument @[find_option()] will fail. @[def] can be specified as - //! @[UNDEFINED] or left out if the option does not take an argument. + //! option is not present.   //! -  + //! The value may be one of: + //! @mixed + //! @type int(0)|zero + //! The option does not require a value. + //! @type int(1)|string + //! The option requires a value, and @[def] will be returned + //! if the option is not present. If the option is present, + //! but does not have an argument @[find_option()] will fail. + //! + //! Note that a set option will always return a @expr{string@}, + //! so setting @[def] to @expr{1@} can be used to detect whether + //! the option is present or not. + //! @endmixed + //!   //! @param throw_errors   //! If @[throw_errors] has been specified @[find_option()] will   //! throw errors on failure. If it has been left out, or is   //! @expr{0@} (zero), it will instead print an error message on   //! @[Stdio.stderr] and exit the program with result code 1 on   //! failure.   //!   //! @returns   //! Returns the value the option has been set to if any.   //!