pike.git / lib / modules / Getopt.pmod

version» Context lines:

pike.git/lib/modules/Getopt.pmod:108:   //!   string|int(0..1) find_option(array(string) argv,    array(string)|string shortform,    array(string)|string|void longform,    array(string)|string|void envvars,    string|int(0..1)|void def,    int|void throw_errors)   {    string|int(0..1) value;    -  int(0..1) hasarg = !zero_type(def); +  int(0..1) hasarg = !undefinedp(def);    if(!arrayp(longform)) longform = ({ [string]longform });    if(!arrayp(shortform)) shortform = ({ [string]shortform });    if(stringp(envvars)) envvars = ({ [string]envvars });       foreach(argv; int i; string opt) {    if(!i || !opt || sizeof(opt)<2 || opt[0]!='-') continue;       if(opt[1] == '-') {    if(opt=="--") break;