From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 20/22] conf: Fix support for --stderr as short option (-e) Date: Fri, 28 Jan 2022 19:33:55 +0100 Message-ID: <20220128183357.3407606-21-sbrivio@redhat.com> In-Reply-To: <20220128183357.3407606-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6172005498625006587==" --===============6172005498625006587== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I forgot --stderr could also be -e, fix handling. Signed-off-by: Stefano Brivio --- conf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/conf.c b/conf.c index 7859f25..9a9dade 100644 --- a/conf.c +++ b/conf.c @@ -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"); -- 2.33.0 --===============6172005498625006587==--