Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/wgconfig Make `wgconfig --help' and variations work.



details:   https://anonhg.NetBSD.org/src/rev/e63783ed97f5
branches:  trunk
changeset: 937506:e63783ed97f5
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Aug 20 21:31:26 2020 +0000

description:
Make `wgconfig --help' and variations work.

diffstat:

 usr.sbin/wgconfig/wgconfig.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 3ed5d4e3fd6a -r e63783ed97f5 usr.sbin/wgconfig/wgconfig.c
--- a/usr.sbin/wgconfig/wgconfig.c      Thu Aug 20 21:31:16 2020 +0000
+++ b/usr.sbin/wgconfig/wgconfig.c      Thu Aug 20 21:31:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wgconfig.c,v 1.1 2020/08/20 21:28:02 riastradh Exp $   */
+/*     $NetBSD: wgconfig.c,v 1.2 2020/08/20 21:31:26 riastradh Exp $   */
 
 /*
  * Copyright (C) Ryota Ozaki <ozaki.ryota%gmail.com@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: wgconfig.c,v 1.1 2020/08/20 21:28:02 riastradh Exp $");
+__RCSID("$NetBSD: wgconfig.c,v 1.2 2020/08/20 21:31:26 riastradh Exp $");
 
 #include <sys/ioctl.h>
 
@@ -729,7 +729,10 @@
        const char *command;
        const char *target;
 
-       if (argc < 2) {
+       if (argc < 2 ||
+           strcmp(argv[1], "-h") == 0 ||
+           strcmp(argv[1], "-?") == 0 ||
+           strcmp(argv[1], "--help") == 0) {
                usage();
        }
 



Home | Main Index | Thread Index | Old Index