All arguments after "--" are treated as non-options. This can be
used to handle option-like filenames (those starting with "-" and "--").
-/* Generated by re2c 0.14.3 on Tue Jul 21 12:00:08 2015 */
+/* Generated by re2c 0.14.3 on Tue Jul 21 13:43:41 2015 */
#include <stdio.h>
#include "src/conf/msg.h"
{ if (!opts.source ("<stdin>")) return EXIT_FAIL; goto opt; }
yy11:
++YYCURSOR;
- { goto end; }
+ {
+ // all remaining arguments are non-options
+ // so they must be input files
+ // re2c expects exactly one input file
+ if (const char * f = *++argv)
+ {
+ if (!opts.source (f) || *++argv)
+ {
+ return EXIT_FAIL;
+ }
+ }
+ goto end;
+ }
yy13:
++YYCURSOR;
yych = *YYCURSOR;
return EXIT_FAIL;
}
- "--" end { goto end; }
+ "--" end
+ {
+ // all remaining arguments are non-options
+ // so they must be input files
+ // re2c expects exactly one input file
+ if (const char * f = *++argv)
+ {
+ if (!opts.source (f) || *++argv)
+ {
+ return EXIT_FAIL;
+ }
+ }
+ goto end;
+ }
"-" end { if (!opts.source ("<stdin>")) return EXIT_FAIL; goto opt; }
filename end { if (!opts.source (*argv)) return EXIT_FAIL; goto opt; }