git: 11500481c82c - main - mptable: improve error reporting for invalid commands
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 16 Jan 2024 00:58:00 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=11500481c82c9fa6e7d3b9a707bd9ca1ed637c2d
commit 11500481c82c9fa6e7d3b9a707bd9ca1ed637c2d
Author: Pete Zaitcev <zaitcev@redhat.com>
AuthorDate: 2024-01-15 21:42:28 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-01-16 00:57:28 +0000
mptable: improve error reporting for invalid commands
mptable ignores arguments with matching first letters, report errors
when it gets garbate.
PR: 38727
Reviewed by: imp
---
usr.sbin/mptable/mptable.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/usr.sbin/mptable/mptable.c b/usr.sbin/mptable/mptable.c
index 0d1e169ec96f..a879279a2d4e 100644
--- a/usr.sbin/mptable/mptable.c
+++ b/usr.sbin/mptable/mptable.c
@@ -183,19 +183,21 @@ main( int argc, char *argv[] )
if ( strcmp( optarg, "mesg") == 0 )
dmesg = 1;
else
- dmesg = 0;
+ usage();
break;
case 'h':
- if ( strcmp( optarg, "elp") == 0 )
- usage();
- break;
+ usage();
case 'g':
if ( strcmp( optarg, "rope") == 0 )
grope = 1;
+ else
+ usage();
break;
case 'v':
if ( strcmp( optarg, "erbose") == 0 )
verbose = 1;
+ else
+ usage();
break;
default:
usage();