pike.git / lib / modules / Arg.pmod

version» Context lines:

pike.git/lib/modules/Arg.pmod:408:    }       protected string __sprintf()    {    return sprintf("Arg.HasOpt(%O)", opt);    }    }      } // -- OptLibrary    - object REST = class { -  protected string _sprintf(int t) + protected class LookupKey   { -  return "Arg.REST"; +  protected string name; +  protected void create(string name) { this::name = name; } +  protected string _sprintf(int t) { return t=='O' && "Arg."+name; }   } -  }(); +     -  + LookupKey REST = LookupKey("REST"); + LookupKey APP = LookupKey("APP"); + LookupKey PATH = LookupKey("PATH"); +    //! @decl constant REST = REST();   //!   //! Constant used by Arg.parse() to indicate the remaining objects.    -  +    // FIXME: Support for rc files? ( Opt x = Opt("--x")|INIFile(path, name); )   // FIXME: Support for type casts? ( Opt level = Integer(Opt("--level"));      class LowOptions    //!   {    protected inherit OptLibrary;       //!    protected mapping(string:Opt) opts = ([]);
pike.git/lib/modules/Arg.pmod:523:      //! The option parser class that contains all the argument objects.   //!   class Options   {    inherit LowOptions;       protected mixed `[](mixed id)    {    if( id==REST ) return argv; +  if( id==PATH ) return application; +  if( id==APP ) return basename(application);    return values[id];    }       protected mixed `->(string id)    {    return values[id];    }       //!    protected int(0..1)|string unhandled_argument(array(string) argv,