diff options
Diffstat (limited to 'vppapigen/lex.c')
-rw-r--r-- | vppapigen/lex.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vppapigen/lex.c b/vppapigen/lex.c index 88744ff1029..b011044dd01 100644 --- a/vppapigen/lex.c +++ b/vppapigen/lex.c @@ -331,13 +331,17 @@ int main (int argc, char **argv) if (!strncmp (argv [curarg], "--python", 8)) { curarg++; if (curarg < argc) { - pythonfp = fopen (argv[curarg], "w"); + if (!strcmp(argv[curarg], "-")) { + pythonfp = stdout; + } else { + pythonfp = fopen(argv[curarg], "w"); + pythonfile = argv[curarg]; + } if (pythonfp == NULL) { fprintf (stderr, "Couldn't open python output file %s\n", argv[curarg]); exit (1); } - pythonfile = argv[curarg]; curarg++; } else { fprintf(stderr, "Missing filename after --python\n"); |