summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl/bgpctl.c
diff options
context:
space:
mode:
authorjob <job@cvs.openbsd.org>2021-06-16 16:24:13 +0000
committerjob <job@cvs.openbsd.org>2021-06-16 16:24:13 +0000
commit61f0e52954bd34c7a7334189dea74993898fb15c (patch)
treec7b27d26f75244d1a945bc7de2b07995c6395cbf /usr.sbin/bgpctl/bgpctl.c
parentbd7a51ed0a28cd7554fe920069492c999da6c32b (diff)
Add command line option to show the version
OK claudio@
Diffstat (limited to 'usr.sbin/bgpctl/bgpctl.c')
-rw-r--r--usr.sbin/bgpctl/bgpctl.c8
1 files changed, 6 insertions, 2 deletions
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 <henning@openbsd.org>
@@ -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 */