pike.git / lib / modules / Getopt.pmod

version» Context lines:

pike.git/lib/modules/Getopt.pmod:1:   #pike __REAL_VERSION__    - //! @[Getopt] is a group of function which can be used to find command + //! @[Getopt] is a group of functions which can be used to find command   //! line options.   //!   //! Command line options come in two flavors: long and short. The short ones   //! consists of a dash followed by a character (@tt{-t@}), the long ones   //! consist of two dashes followed by a string of text (@tt{--test@}).   //! The short options can also be combined, which means that you can write   //! @tt{-tda@} instead of @tt{-t -d -a@}.   //!   //! Options can also require arguments, in which case they cannot be   //! combined. To write an option with an argument you write
pike.git/lib/modules/Getopt.pmod:60:   //! Also, as an extra bonus: @[shortform], @[longform] and @[envvars] can   //! all be arrays, in which case any of the options in the array will be   //! accepted.   //!   //! @returns   //! Returns the value the option has been set to if any.   //!   //! If the option is present, but has not been set to anything @tt{1@}   //! will be returned.   //! - //! Otherwise if any of the environment variables specified in @[env] has + //! Otherwise if any of the environment variables specified in @[envvars] has   //! been set, that value will be return.   //!   //! If all else fails, @[def] will be returned.   //!   //! @note   //! @[find_option()] modifies argv.   //!   //! This function reads options even if they are written after the first   //! non-option on the line.   //!
pike.git/lib/modules/Getopt.pmod:190:    if(value && (value=[string]getenv([string]value)))    return value;       return def;   }      /*    * ({ "name", type, ({aliases}), env_var, default })    */    + //!   constant HAS_ARG=1; -  +  + //!   constant NO_ARG=2; -  +  + //!   constant MAY_HAVE_ARG=3;      #define NAME 0   #define TYPE 1   #define ALIASES 2   #define ENV 3   #define DEF 4      //! This function does the job of several calls to @[find_option()].   //! The main advantage of this is that it allows it to handle the