From nobody Tue Jan 16 00:58:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDVx43MLSz57xdw; Tue, 16 Jan 2024 00:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDVx42gg7z4Qdk; Tue, 16 Jan 2024 00:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705366680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TdhQWyhVr6VHUiYel4n78KmZlCTPlUpH1/dwTjTlayY=; b=wnfvA9EF8Tf7RkT8yF6HzeuF0rDyVvhY8pe/lK36WQAk/jl/+hhNG1y7tol88b3aSwGZGr 1T124GztHwnHNnqLkum8wJXfQeRl2bz+ogSTk8DY2SE8PBPe6OH16m94jxUyYy1NN800XD fzybGWAqjpphmd73+B2HVBSuLh4yWXFjXN0s3GnN44A/el/n+/98K2I4Hl6gWjtSEmzjVL 36YSa9TeBfLySISs3HYe2Ycu569WvmyWI4kUfQsc1kKX34JzMI4hDpjfe00aQqE/urCmvO x08Ql+S0hvfSm333BEYM6nLxdRLVQGIWinA4AGR7DKZSOFkgDcXBUjFlMMfbAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705366680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TdhQWyhVr6VHUiYel4n78KmZlCTPlUpH1/dwTjTlayY=; b=sYL80Ui1SQqyqrkjq2Q7TfegWJPVthReGmjInuMwboHXQaA8PxJdS8BM/YFoihfAI0xLQA 2O27gHmd5plqwYOt4Obwb/9ecVKOyMxpOeqRHf0KyheVq8eSZDIvqRC2au9Zu0rWMu3f01 dD1VD+DDRYkt+i5+6sb6ZEK2z/OAKYz8e0PhZPpfeoHX+0kpQgbG75tcpCFAGz7hBt+fv1 CSwQdrwz67mUrWdEMqvMFjvGLgSevho6cNsodYyGNrc0KZVU7VgjwhA9H5iMHomWv05K2x v7r6784QRPfolsE418idJS1bDndUWms2TAiSwxNAviH33hdDlyMbysGGidNqNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705366680; a=rsa-sha256; cv=none; b=MuFxkWTUMlZn3F1VPtBUHbXl3KfwtAx1fWjAryU50qDUdWwulB/PUKmC6wGniwuvqMli1N J0RhccC8tUn+M2l3OHhksbiq9irlXuf44DoF70pcnRFUWA45ceQlUjsYv2opT01EQmR48a AX3q2J6MF7Wn9Upchq7C+zhZU8YoBiQtTYwNGutX26PL2uvhbkLcU2SRIEhRyu1ziO4N8w XkSxKOc6P3zFoZbJ3MBdrZX9VQDtyoo0fYupdiypsRqKZMKIjSAMRrr7ojlklGA/iT7Uk6 ch96xdc82fKfaiJykB82o9AFfSHLvZqe6arGQa2lV/34pTUcqivl9/eKbBuhpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDVx41cFbzJ9Y; Tue, 16 Jan 2024 00:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G0w0FW070489; Tue, 16 Jan 2024 00:58:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G0w0M4070486; Tue, 16 Jan 2024 00:58:00 GMT (envelope-from git) Date: Tue, 16 Jan 2024 00:58:00 GMT Message-Id: <202401160058.40G0w0M4070486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 11500481c82c - main - mptable: improve error reporting for invalid commands List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11500481c82c9fa6e7d3b9a707bd9ca1ed637c2d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=11500481c82c9fa6e7d3b9a707bd9ca1ed637c2d commit 11500481c82c9fa6e7d3b9a707bd9ca1ed637c2d Author: Pete Zaitcev AuthorDate: 2024-01-15 21:42:28 +0000 Commit: Warner Losh 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();