Skip to content
Snippets Groups Projects
Commit fcf728dd authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

added -E (for preprocessing)

Rev: lib/master.pike.in:1.20
parent bc68dccf
No related branches found
No related tags found
No related merge requests found
/* $Id: master.pike.in,v 1.19 1998/04/24 18:18:49 hubbe Exp $ /* $Id: master.pike.in,v 1.20 1998/04/29 00:18:38 hubbe Exp $
* *
* Master-file for Pike. * Master-file for Pike.
* *
...@@ -539,6 +539,7 @@ void _main(string *orig_argv, string *env) ...@@ -539,6 +539,7 @@ void _main(string *orig_argv, string *env)
({"version",tmp->NO_ARG,({"-v","--version"})}), ({"version",tmp->NO_ARG,({"-v","--version"})}),
({"help",tmp->NO_ARG,({"-h","--help"})}), ({"help",tmp->NO_ARG,({"-h","--help"})}),
({"execute",tmp->HAS_ARG,({"-e","--execute"})}), ({"execute",tmp->HAS_ARG,({"-e","--execute"})}),
({"preprocess",tmp->HAS_ARG,({"-E","--preprocess"})}),
({"modpath",tmp->HAS_ARG,({"-M","--module-path"})}), ({"modpath",tmp->HAS_ARG,({"-M","--module-path"})}),
({"ipath",tmp->HAS_ARG,({"-I","--include-path"})}), ({"ipath",tmp->HAS_ARG,({"-I","--include-path"})}),
({"ppath",tmp->HAS_ARG,({"-P","--program-path"})}), ({"ppath",tmp->HAS_ARG,({"-P","--program-path"})}),
...@@ -610,6 +611,10 @@ void _main(string *orig_argv, string *env) ...@@ -610,6 +611,10 @@ void _main(string *orig_argv, string *env)
case "execute": case "execute":
compile_string("#include <simulate.h>\nmixed create(){"+opts[1]+";}")(); compile_string("#include <simulate.h>\nmixed create(){"+opts[1]+";}")();
exit(0); exit(0);
case "preprocess":
_static_modules.files()->_stdout->write(cpp(_static_modules.files()->Fd(opts[1],"r")->read(),opts[1]));
exit(0);
} }
} }
...@@ -649,14 +654,15 @@ void _main(string *orig_argv, string *env) ...@@ -649,14 +654,15 @@ void _main(string *orig_argv, string *env)
#if constant(_debug) #if constant(_debug)
if(debug) _debug(debug); if(debug) _debug(debug);
#endif #endif
if(trace) predef::trace(trace);
if(!script->main) if(!script->main)
{ {
werror("Error: "+argv[0]+" has no main().\n"); werror("Error: "+argv[0]+" has no main().\n");
exit(1); exit(1);
} }
if(trace) predef::trace(trace);
i=script->main(sizeof(argv),argv,env); i=script->main(sizeof(argv),argv,env);
predef::trace(0);
if(i >=0) exit(i); if(i >=0) exit(i);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment