Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2025 15:52:24 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 73ba568b1c35 - main - pkg: suppress error on unknown options
Message-ID:  <202505051552.545FqOXU032598@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=73ba568b1c35aabc1682540b5b4d5d77220c5468

commit 73ba568b1c35aabc1682540b5b4d5d77220c5468
Author:     Isaac Freund <ifreund@freebsdfoundation.org>
AuthorDate: 2025-05-05 08:03:08 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-05-05 15:52:08 +0000

    pkg: suppress error on unknown options
    
    pkg(7) does not understand all the options that pkg(8) understands and
    should never log errors about unknown options that it will pass on to
    pkg(8) without touching.
    
    PR:             286510
    Reviewed by:    bapt
    Fixes:          be61deae0aa2 ("pkg: clarify argument parsing")
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D50163
---
 usr.sbin/pkg/pkg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index b62eecfc6dce..7899fbaeaf09 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -1164,7 +1164,7 @@ main(int argc, char *argv[])
 				{ "yes",	no_argument,	NULL,	'y' },
 				{ NULL,		0,		NULL,	0   },
 			};
-			while ((ch = getopt_long(argc, argv, "+y",
+			while ((ch = getopt_long(argc, argv, "+:y",
 			    sub_longopts, NULL)) != -1) {
 				switch (ch) {
 				case 'y':



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505051552.545FqOXU032598>