From nobody Mon May 05 14:48:02 2025 X-Original-To: dev-commits-src-all@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 4Zrksf1gphz5vbqy; Mon, 05 May 2025 14:48:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zrksd1bMgz3dV1; Mon, 05 May 2025 14:48:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.32 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id Bvzqu3ySf9JM2Bx6yuNJTk; Mon, 05 May 2025 14:48:04 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id Bx6wutsFVQwcXBx6xuhLz4; Mon, 05 May 2025 14:48:04 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=DaW0qetW c=1 sm=1 tr=0 ts=6818cfa4 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=dt9VzEwgFbYA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=IP17e_1XAAAA:8 a=YxBL1-UpAAAA:8 a=DvCXEiIYZSf0Gy-XlbUA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=pIDkZDmBs-rV6VORH8mB:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 8373DD8; Mon, 05 May 2025 07:48:02 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 7CC0D304; Mon, 05 May 2025 07:48:02 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: be61deae0aa2 - main - pkg: clarify argument parsing In-reply-to: <202504300101.53U112aW053506@gitrepo.freebsd.org> References: <202504300101.53U112aW053506@gitrepo.freebsd.org> Comments: In-reply-to Ed Maste message dated "Wed, 30 Apr 2025 01:01:02 +0000." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 05 May 2025 07:48:02 -0700 Message-Id: <20250505144802.7CC0D304@slippy.cwsent.com> X-CMAE-Envelope: MS4xfH+3noQE9Ja7LebOg/9bJ7SgTheaVAT2BERYKkbSp9SMcy/k5ZJPrjpgFgvCZOKGOkOYPZwx+nMPddYNvy39StJj4eFc6uXs4X87nfhq5yKjSDijofkJ 3GHgxGm7tq9dPEbPZoWxqveyALM/DyLOAakA1RzZXq9qov5RtGUi7+hxYNawVO0AT0dCm38+kAgZdgpM2/FxjX1xQl7sXAXHyUThtm83+/vhBxHWwd/bKU1G vCfdRjZcqu0fRhTffMtZW3Y/afOHnwFalIPHxoZqmq8QK0ROJhVNZKL+B6+RvOHBSj2aInSnx9QFLSrGe3CsOMHV2l3SbBiQA7gDq96vt4o= X-Rspamd-Queue-Id: 4Zrksd1bMgz3dV1 X-Spamd-Bar: / X-Spamd-Result: default: False [-0.82 / 15.00]; NEURAL_SPAM_LONG(0.98)[0.983]; NEURAL_HAM_SHORT(-0.98)[-0.977]; NEURAL_HAM_MEDIUM(-0.93)[-0.927]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.32:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; REPLYTO_EQ_FROM(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; RCPT_COUNT_THREE(0.00)[4] In message <202504300101.53U112aW053506@gitrepo.freebsd.org>, Ed Maste writes: > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=be61deae0aa2923bb9908fc5b37b3571 > 2603e622 > > commit be61deae0aa2923bb9908fc5b37b35712603e622 > Author: Isaac Freund > AuthorDate: 2025-04-23 10:27:35 +0000 > Commit: Ed Maste > CommitDate: 2025-04-30 01:00:17 +0000 > > pkg: clarify argument parsing > > Currently pkg parses all arguments and subcommands in a single > getopt_long() loop. This results in quite a bit of accidental > complexity, especially around the -r option for the bootstrap and add > subcommands. > > This also results in the undocumented behavior of all options understood > by pkg(7) being accepted anywhere in the argument list regardless of > their position. This contradicts the behavior of pkg(8) and I find it > quite unexpected. > > This patch splits the argument parsing done by pkg(7) into two phases > for global options and subcommand options. This gives behavior that > matches pkg(8), accepting the subset of pkg(8) options supported by > pkg(7) in the exact same positions that pkg(8) accepts them. > > This is however a somewhat breaking change, as options are no longer > accepted by pkg(7) in places they are rejected by pkg(8). For example, > `pkg -f bootstrap` no longer works, only `pkg bootstrap -f`. > > The original motivation for writing this patch was investigating support > for --rootdir in pkg(7). Since pkg(8) uses -r as the short form for > both --rootdir and --repository depending on the position, I decided > that pkg(7) needed to be brought inline with pkg(8)'s argument parsing > behavior to avoid confusion. > > This patch also gets rid of args_add_message (unused since 40b9f924b1) > > Relnotes: yes > Reviewed by: bapt > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D49977 > --- > usr.sbin/pkg/pkg.7 | 5 +- > usr.sbin/pkg/pkg.c | 174 ++++++++++++++++++++++++++------------------------- > -- > 2 files changed, 87 insertions(+), 92 deletions(-) > Hi Ed, This commit is causing option parsing errors. Please see the discussion about it on -current. I've reverted it locally. Problem fixed. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0