3 * Standalone tool to manipulate a program's command line
5 * C version by Wessel Dankers <wsl@fruit.eu.org>
7 * This code is in the public domain.
16 static void print_usage(const char *progname)
18 fprintf(stderr, "Command line usage: %s [flags] -- prefix [recipients]\n", progname);
22 int main(int argc, char **argv)
24 char **opts = NULL, **opt = NULL;
32 opts = malloc((2 * argc + 1) * sizeof(*opts));
43 for (int i = 2; i < argc;)
45 if (strcmp(argv[i], "--") == 0)
61 execvp(opts[0], opts);