From 61f0e52954bd34c7a7334189dea74993898fb15c Mon Sep 17 00:00:00 2001 From: job Date: Wed, 16 Jun 2021 16:24:13 +0000 Subject: Add command line option to show the version OK claudio@ --- usr.sbin/bgpctl/bgpctl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr.sbin/bgpctl/bgpctl.c') diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index 13bc565bd86..08214066235 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.268 2021/05/27 08:29:06 claudio Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.269 2021/06/16 16:24:11 job Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -39,6 +39,7 @@ #include "bgpd.h" #include "session.h" #include "rde.h" +#include "version.h" #include "bgpctl.h" #include "parser.h" @@ -94,7 +95,7 @@ main(int argc, char *argv[]) if (asprintf(&sockname, "%s.%d", SOCKET_NAME, tableid) == -1) err(1, "asprintf"); - while ((ch = getopt(argc, argv, "jns:")) != -1) { + while ((ch = getopt(argc, argv, "jns:V")) != -1) { switch (ch) { case 'n': if (++nodescr > 1) @@ -106,6 +107,9 @@ main(int argc, char *argv[]) case 's': sockname = optarg; break; + case 'V': + fprintf(stderr, "OpenBGPD %s\n", BGPD_VERSION); + return 0; default: usage(); /* NOTREACHED */ -- cgit v1.2.3