diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-01-27 16:42:19 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-01-27 16:44:05 +0100 |
commit | ffc3183ac15c1262c391acf492bd69f802362f35 (patch) | |
tree | a4ddf26933d794cea68505a7a781c22d84366d17 | |
parent | 1802871e9ef8516f7817046a27a7f2121ae2b0b1 (diff) | |
download | passt-ffc3183ac15c1262c391acf492bd69f802362f35.tar passt-ffc3183ac15c1262c391acf492bd69f802362f35.tar.gz passt-ffc3183ac15c1262c391acf492bd69f802362f35.tar.bz2 passt-ffc3183ac15c1262c391acf492bd69f802362f35.tar.lz passt-ffc3183ac15c1262c391acf492bd69f802362f35.tar.xz passt-ffc3183ac15c1262c391acf492bd69f802362f35.tar.zst passt-ffc3183ac15c1262c391acf492bd69f802362f35.zip |
conf: Fix support for --stderr as short option (-e)
I forgot --stderr could also be -e, fix handling.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | conf.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -766,7 +766,7 @@ void conf(struct ctx *c, int argc, char **argv) {"debug", no_argument, NULL, 'd' }, {"quiet", no_argument, NULL, 'q' }, {"foreground", no_argument, NULL, 'f' }, - {"stderr", no_argument, &c->stderr, 1 }, + {"stderr", no_argument, NULL, 'e' }, {"help", no_argument, NULL, 'h' }, {"socket", required_argument, NULL, 's' }, {"ns-ifname", required_argument, NULL, 'I' }, @@ -889,6 +889,14 @@ void conf(struct ctx *c, int argc, char **argv) c->debug = 1; c->foreground = 1; break; + case 'e': + if (c->stderr) { + err("Multiple --stderr options given"); + usage(argv[0]); + } + + c->stderr = 1; + break; case 'q': if (c->quiet) { err("Multiple --quiet options given"); |