/*
* "Interpreter" that you can put in #! like this
* #!/usr/bin/cgi-fcgi-interp [<options>] <interpreter>
+ *
+ * Usages:
+ * cgi-fcgi-interp [<option> ..] <interpreter> <script> [<ignored> ...]
+ * cgi-fcgi-interp [<option>,..],<interpreter> <script> [<ignored> ...]
+ * cgi-fcgi-interp '[<option> ..] <interpreter>' <script> [<ignored> ...]
*/
/*
* cgi-fcgi-interp.[ch] - Convenience wrapper for cgi-fcgi
#include "prefork.h"
+#define STAGE2_VAR "CHIARKUTILS_CGIFCGIINTERP_STAGE2"
+
static const char *stage2;
+const char our_name[] = "cgi-fcgi-interp";
+
const struct cmdinfo cmdinfos[]= {
{ "help", 0, .call=of_help },
{ 0, 'g', 1, .sassignto= &ident },
static void start_logging(void);
static void await_something(void);
-int main(int argc, const char *const *argv) {
+int main(int unused_argc, const char *const *argv) {
int r;
stage2 = getenv(STAGE2_VAR);
if (r) diee("close saved stderr fd");
}
- script = process_opts(argc, argv);
+ process_opts(&argv);
+ if (!script) badusage("need script argument");
if (!stage2) {