pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.140 2001/01/19 13:51:37 mirar Exp $ +  * $Id: master.pike.in,v 1.141 2001/01/19 14:06:07 mirar Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #pike __REAL_VERSION__   #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:1201:    * and an array containing the environment variables on the same form as    * a C program receives them.    */   void _main(array(string) orig_argv, array(string) env)   {    array(string) argv=copy_value(orig_argv);    int i,debug,trace;    object tmp;    string a,b;    array q; -  int list_features=0; +  string postparseaction=0; +  mixed v;       _pike_file_name = orig_argv[0];       foreach(env,a)    {    if(sscanf(a,"%s=%s",a,b))    {    if(a=="") // Special hack for NT    {    sscanf(b,"%s=%s",a,b);
pike.git/lib/master.pike.in:1248:    werror("master.pike: Couldn't resolv Getopt module.\n"    "Is your PIKE_MODULE_PATH environment variable set correctly?\n");    exit(1);    }       q=tmp->find_all_options(argv,({    ({"compat_version",tmp->HAS_ARG,({"-V","--compat"})}),    ({"version",tmp->NO_ARG,({"-v","--version"})}),    ({"help",tmp->NO_ARG,({"-h","--help"})}),    ({"features",tmp->NO_ARG,({"--features"})}), +  ({"info",tmp->NO_ARG,({"--info"})}),    ({"execute",tmp->HAS_ARG,({"-e","--execute"})}),    ({"debug_without",tmp->HAS_ARG,({"--debug-without"})}),    ({"preprocess",tmp->HAS_ARG,({"-E","--preprocess"})}),    ({"modpath",tmp->HAS_ARG,({"-M","--module-path"})}),    ({"ipath",tmp->HAS_ARG,({"-I","--include-path"})}),    ({"ppath",tmp->HAS_ARG,({"-P","--program-path"})}),    ({"showpaths",tmp->NO_ARG,"--show-paths"}),    ({"warnings",tmp->NO_ARG,({"-w","--warnings"})}),    ({"nowarnings",tmp->NO_ARG,({"-W", "--woff", "--no-warnings"})}),   #ifdef PIKE_AUTORELOAD
pike.git/lib/master.pike.in:1381:    case "help":    werror("Usage: pike [-driver options] script [script arguments]\n"    "Driver options include:\n"    " -I --include-path=<p>: Add <p> to the include path\n"    " -M --module-path=<p> : Add <p> to the module path\n"    " -P --program-path=<p>: Add <p> to the program path\n"    " -e --execute=<cmd> : Run the given command instead of a script.\n"    " -h --help : see this message\n"    " -v --version : See what version of pike you have.\n"    " --features : List Pike features.\n" +  " --info : List information about the Pike build and setup.\n"    " --show-paths : See the paths and master that pike uses.\n"    " -s# : Set stack size\n"    " -m <file> : Use <file> as master object.\n"    " -d -d# : Increase debug (# is how much)\n"    " -t -t# : Increase trace level\n"    );    exit(0);       case "features": -  list_features=1; +  postparseaction="features";    break;    -  +  case "info": +  postparseaction="info"; +  break; +     case "showpaths":    werror("Include path : " + pike_include_path*"\n"    " " + "\n"    "Module path : " + pike_module_path*"\n"    " " + "\n"    "Program path : " + pike_program_path*"\n"    " " + "\n"    "Master file : " + (_master_file_name || __FILE__) + "\n");    exit(0);   
pike.git/lib/master.pike.in:1418:    case "preprocess":    _static_modules.files()->_stdout->write(cpp(master_read_file(opts[1]),    opts[1]));    exit(0);    }    }       argv = tmp->get_args(argv,1);    }    -  if (list_features) +  switch (postparseaction)    { -  mixed v; -  +  case "features":    v = resolv("Tools");    if (v) v = v["Install"];    if (v) v = v["features"];    if (!v)    {    werror("Could not resolv Tools.Install.features\n");    exit(1);    }       _static_modules.files()->_stdout->write(v()*"\n"+"\n");    exit(0); -  +  +  case "info": +  function w=_static_modules.files()->_stdout->write; +  w("Software......Pike\n" +  "Version......."+version()+"\n" +  "WWW...........http://pike.idonex.se/\n" +  "Main author...Fredrik Hübinette\n" +  "\n"); +  +  w("pike binary..."+_pike_file_name+"\n"); +  w("master.pike..."+__FILE__+"\n"); +  +  w("Module path..." + pike_module_path*"\n" +  " " + "\n" +  "Include path.." + pike_include_path*"\n" +  " " + "\n" +  "Program path.." + pike_program_path*"\n" +  " " + "\n" +  "\n"); +  +  v = resolv("Tools"); +  if (v) v = v["Install"]; +  if (v) v = v["features"]; +  if (!v) +  { +  werror("Could not resolv Tools.Install.features\n"); +  exit(1);    }    -  +  w("Features......"+v()*"\n "+"\n"); +  +  +  exit(0); +  } +     random_seed(time() + (getpid() * 0x11111111));       if(sizeof(argv)==1)    {    /* Attempt to resolv Tools.Hilfe.StdinHilfe */    tmp = resolv("Tools");    if (!tmp) {    werror("Couldn't find Tools.\n");    exit(1);    }