From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11455 invoked from network); 6 Jan 2023 12:53:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Jan 2023 12:53:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1673009583; b=LGXA3nJB/7E3SBxqIYTqVZbNII1zaiPK+MIekrm0wCnpr4ifxsEFIPshiS9RzReDiBcGKb6TRg Y4Ch+zN0Usp9cSXQoSQ1OFyZa8Jx96O3mkAmp5kWumsockheKbo/OnAC02qfRN6or+SQXRVlPs sgv9LUORj4jjt7NydzjvS/e061fKeGe5lxAuZC92q6V4ROzI/14SkutrdfWd9KafJWxXcvqBOX IlSeoPIP5aHoEAPUnfPVDDlMWXyumzD2dCHWWvx9THOo66rRnnZT4CpZiWN1chjKNmczmsOas8 STMsbEk564U5GJB1wQ/A7OyNySPeJX4IzBiY1xdLVjD6Yg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1673009583; bh=DcHYqv5eD8OMvox3abOHRyHEPpOdu+yuH0wmRwiwlj4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=OJisb+ilQ5YwpKywyQb4Ak/roMbAqyEaBjMXHSGNocWR/AAxgflTXwDZ3Y4/YLD7zGUOFlUpoQ mczEAMkgpKt+MAHTX47O9QsOehKfcCc2zJUD11YnDp4tCHfL2OmAprUOr77z4vbaJShmopQG8B sSOjLeH++jc96rgMpp7CAbHiGQzqe4RWKefluJEzvdYXITqdyyo0eIwgufmhOjEo8XcIQPDeZW ftHsGONep1a7fdRpr+x6f/cumQAizYhSwLH998+Akq41zt2GZ9qQoqS2m6n0LRPWQKQbZ8PkQf lWRSgcnJKjX+k2lmKEXr3K7zWrS6pC7EpfCDqGHjc3cdlg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=vgSbTMYhnbcdG4zjgtSqpM6865YGiICwdqdfG6DKcDQ=; b=F0f/DtSoWauEOmnQzbz8oyf0f1 74KSftNqnMqsjsM+QbSR9lpzM9IIo4qYXQv55jXlN0Q9sHqKsZKylNH+ZBbI5OedlRRKksr3RUjcS bFeoAKZ8SCCcpyYUCTGgyWGI1thioP/LFOg4gZ2nYal5BdYKQS9UpnmoO3lmlvALCnArMbZr4DbFo MnieVAr0XqngLiLL4QzakSYzbdEKvauEO8mj/+c1V53ht40TGSnz4QAZrYbWbDxc0JXMClQCwH4qp z5AsUhzv7yr9Iz2Q8yhjSUh26GoTTtF8xlZsydMxu6X9RAov+cQbOYP2FiBFeI9RPbnXQEIeowOQ4 vtDK4zPg==; Received: by zero.zsh.org with local id 1pDmDW-000Go7-8f; Fri, 06 Jan 2023 12:53:02 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:47575) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1pDmCc-000G8z-V7; Fri, 06 Jan 2023 12:52:08 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 4771C5C00C9; Fri, 6 Jan 2023 07:52:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 06 Jan 2023 07:52:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1673009525; x=1673095925; bh=vgSbTMYhnb cdG4zjgtSqpM6865YGiICwdqdfG6DKcDQ=; b=n68Ase6H8L1gb11a2vnsJjOl8e VAJtTY+Yp5l20d0AhYCmNF0QahELvv5z+fGpryZtbSLDWzDZoJTueSFJ5V/UxVPf wmKQ5q9NF2BWcgBqq/VaNsDDv1ahw9TXBR4wjQgr1pEGwlWEVF7zsrxgqnb1T8Te 65Ma12DiJALC8PViskxAutv47q7AvIKZRV+/Jvsqpg0JB1EHy92joFU63nFOY/+t jRN/EDjjpfAjVHwt4Rp7fy7exg3ff82dTiIlXDR5t/gChkye1RcMNYXemOeFpwGk 6lSSL2G68zFU6DyvsDaC/TVNnxOgDnYS5WErBpqWvJI23It3uJ3RgoXTSCuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1673009525; x= 1673095925; bh=vgSbTMYhnbcdG4zjgtSqpM6865YGiICwdqdfG6DKcDQ=; b=i KX9fFjaO+B3WM4MDUnM2S+Akg4XupYKaOgNtahvdvsCxJtSwxSUIHM8GGi9YA/pH 3uzlP9CxEL9gQ+2aC0AurZDFj4vuVFFnllAMP+zKV8aXCQdLMFQmXrh09tb0+Vgl 9PXbEO0AKpvAOxUCHfnZSgQFrsBbTNqFwzcOC7hhUOk5hPwZdMMljWd5fmR3lQW5 2RVruUML7RwoFDcBXb8WzFn0itKJrx/emWt2tkLysK4HvBfD3q+gTYbpReYP7/kC SYrRp9SKFERvQiV6NUbNWjBc3oSUlsbG2IXCYPjKhl8y7PKhz35kVgw/cbbYYT54 8uOzpfdtGul25FUIpQH7Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkedtgdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtugfgjggfsehtkedttddtredunecuhfhrohhmpeffrghn ihgvlhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeeiteeggeffgfffueekgfetjeelhedtudeitdehhfetvddv teefffeugfejjefghfenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghl rdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i425e4195:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 6 Jan 2023 07:52:04 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4NpNX220wXz1FQ; Fri, 6 Jan 2023 12:52:02 +0000 (UTC) Date: Fri, 6 Jan 2023 12:52:02 +0000 From: Daniel Shahaf To: Phil Pennock Cc: zsh-users@zsh.org Subject: Re: completion of normal commands after -- Message-ID: <20230106125202.GJ8411@tarpaulin.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 28616 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Phil Pennock wrote on Tue, Jan 03, 2023 at 19:23:59 -0500: > So you might run: > % aws-vault exec profile-foo -n my-command its-flags-and-args > > I have it _almost_ working. I can see it taking parameters for > aws-vault after the profile name, I can see it switching to _normal > execution and tab-completing commands from the path. The problem comes > with losing tab-completion for my-command's options. > > Eg, I should be able to run: > % aws-vault exec website -- ls - > and see the tab-completion for the ls(1) command. > > Instead, at present, I can tab-complete the first word after the '--' > and no further. (Without the --, it tab-completes aws-vault's options, > which is unfortunately correct: they'll be stolen). That's exactly how «svnadmin freeze» works, and its completion handles this correctly in a similar case, so see if you can crib from it: . The two test cases in comments there work for me under `zsh -f` in 5.9. A third case, with the words (-- .) swapped, offers «`arguments' or `file'», rather than the external command's options. Cheers, Daniel > (exec) > _arguments -s -S -C \ > '(-d --duration)'{-d,--duration=}'[duration of temporary or assume-role session]:duration' \ > '(-n --no-session)'{-n,--no-session}'[use master credentials, no STS session]' \ > '(-t --mfa-token)'{-t,--mfa-token=}'[the MFA token to use]: ' \ > '(-j --json)'{-j,--json}'[be an AWS credential helper]' \ > '(-s --server --ec2-server --ecs-server)'{-s,--server,--ec2-server}'[run EC2 metadata server in background for credentials]' \ > '(-s --server --ec2-server --ecs-server)--ecs-server[run ECS credential server in background for credentials]' \ > '--region=[the AWS region]:region:_aws_regions' \ > '--lazy[When using --ecs-server, lazily fetch credentials]' \ > '--stdout[Print the SSO link to the terminal without automatically opening the browser]' \ > '1:profile name:_aws_profiles' \ > '2:: :->wrapped-command' && return > > case "$state" in > (wrapped-command | '') # '' for the '--' scenario > shift $CURRENT words > CURRENT=1 > _normal -p $service > ;; > esac > ;; > > Guidance appreciated, and thanks in advance, > -Phil >