From 9758697b51cbb8a47612d01a8da9a5b88bf0492e Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Tue, 20 Jan 2004 13:11:40 +0000 Subject: show usage if called without command --- usr.sbin/bgpctl/bgpctl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.sbin/bgpctl') diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index 978d80761ea..7601e1ba56d 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.31 2004/01/20 13:03:39 henning Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.32 2004/01/20 13:11:39 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -33,6 +33,7 @@ #include "log.h" enum actions { + NONE, SHOW, SHOW_SUMMARY, SHOW_NEIGHBOR, @@ -129,7 +130,7 @@ main(int argc, char *argv[]) int fd, n, done; int i, flags; struct imsg imsg; - enum actions action = SHOW_SUMMARY; + enum actions action = NONE; struct bgpd_addr addr; if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { @@ -154,6 +155,9 @@ main(int argc, char *argv[]) again: switch (action) { + case NONE: + usage(); + /* not reached */ case SHOW: if (argc >= 3) { action = match_keyword(argv[2], keywords_show, @@ -302,6 +306,7 @@ again: case SHOW_NEIGHBOR_TIMERS: done = show_neighbor_msg(&imsg, NV_TIMERS); break; + case NONE: case RELOAD: case FIB: case FIB_COUPLE: -- cgit v1.2.3