+ /* it's --optname, check how the parameter is supplied */
+ if (argv[0][ds+len] == '=') {
+ *out = argv[0]+ds+len+1;
+ return true;
+ }
+
+ if (!split || argc < ds) /* no parameter was provided, or only single-arg form accepted */
+ return false;
+
+ /* using --opt param */
+ *out = argv[1];
+ --*argc_;
+ ++*argv_;
+ return true;
+}
+
+#include <stdio.h>
+int main(int argc, char **argv) {
+ bool extract = true;
+ char *redirout = (char*)stdout;
+ char *redirerr = (char*)stderr;
+ char *file = NULL;
+ char **files = NULL;
+ pak_file_t *pak = NULL;
+ size_t iter = 0;
+
+ con_init();
+
+ /*
+ * Command line option parsing commences now We only need to support
+ * a few things in the test suite.
+ */
+ while (argc > 1) {
+ ++argv;
+ --argc;
+
+ if (argv[0][0] == '-') {
+ if (parsecmd("redirout", &argc, &argv, &redirout, 1, false))
+ continue;
+ if (parsecmd("redirerr", &argc, &argv, &redirerr, 1, false))
+ continue;
+ if (parsecmd("file", &argc, &argv, &file, 1, false))
+ continue;
+
+ con_change(redirout, redirerr);
+
+ switch (argv[0][1]) {
+ case 'e': extract = true; continue;
+ case 'c': extract = false; continue;
+ }