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=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26944 invoked from network); 1 Apr 2021 00:00:52 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Apr 2021 00:00:52 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1617235252; b=yuPxyd3sQjLR1T4vAdh+M0b0Yhh/fimFcMU++BjiyOqAWBuOPRfXgGUn4rrDfZvhX34y6WN0ra afWkGRILpqZQevfC0K4EYNnAUPllivHszqWiHoSKKfSKfLA3pen9SmYWjx3CngULPIeA1t5Sae 73X5yhm7SUkryuWzVBKxOfjp2v/XVkqCmTsrXklaX9ZuTIAw2QDehCAi4akzJHpGW5iRKEtLE7 U2rRcd0h3RcrW+xCghjXg6JfJXsksktWjJCYW+gBBKMFGI2drqL7JrvZNe3FUIALLIkgzkmNXf 5cFi/MreXy+aBOCRAK6qlU3Xx7jOtRyP1jnKIbO/jxQIzA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout5-smtp.messagingengine.com) smtp.remote-ip=64.147.123.21; dkim=pass header.d=daniel.shahaf.name header.s=fm3 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-20200801; t=1617235252; bh=1LePv1r94a8EUGTHhOPUu+cDYy9rZHTZn1F7+BIvgaw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:Message-ID:Date: Subject:To:From:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=EUUzWH150FGQIiXijATUsRelRWFreMJqPilch0emeoxvo8EjCNFVnmhidy0ql033KR2c2/aBqT yHrKv+1/nAMf2tyiGmYvpKTDZ8CvzUvZLlVW86+7QniUeebH83AV6e+tN/B8cPP60s2rWc85IV cpUU5f5WaGN9TfH9i1GX+GyB/EJbLY6wTH9NXmMpQNgf2JdhxQAPyhbvuWu3hBiBG4K69GsNw6 nb9PxYTjIgQHNRgox81XitE8gPPBLOkou9srAIXrVez3+TBKL+EHnjD9ML2TOepiPmNfOKi79f 8wWt0R/y9yORELiqvInBPEQOa81cT69W6nDf1zGlBpZx7Q==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=LPpFR6eGDnIi7yiQqrH17s1eRo5H7fhcCryJJeYujUA=; b=HLEnJuGTDsDRudFSGkrxnrKdci o9bwo77aJkxB+zhKeKlslwtMUzumcyAi7IS/rmUuGpmd3HKIQDXCaViFVqc0SKlF0yEg7CS+Wla4K BHEYxfgHV/FgFPt8mpwyHswSXrsqhu+zLzPK6uWcX/qkzo+CsyRpCGg9WpsYndBbYUxlHfk1qRqbl JJsYMGan6e8zAVzh8mZk0w5bFlFresdvkLWrlbU2jDNR40ZqboAsA5zodBbB16ooq5jkt15kW+cB7 HLTbXxU6qrVLVPrUuXY0AC8TXnTomW8ocAgTxzSx0Gig5PoxXmkVLLkXgmzbm8C8q1MKHpEERB17g 3nnHJnGg==; Received: from authenticated user by zero.zsh.org with local id 1lRklW-000Fnz-HK; Thu, 01 Apr 2021 00:00:50 +0000 Authentication-Results: zsh.org; iprev=pass (wout5-smtp.messagingengine.com) smtp.remote-ip=64.147.123.21; dkim=pass header.d=daniel.shahaf.name header.s=fm3 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 wout5-smtp.messagingengine.com ([64.147.123.21]:51725) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lRklF-000FfF-1r; Thu, 01 Apr 2021 00:00:34 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 28E3E2FE0; Wed, 31 Mar 2021 20:00:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 31 Mar 2021 20:00:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=from:to:subject:date:message-id :mime-version:content-transfer-encoding; s=fm3; bh=LPpFR6eGDnIi7 yiQqrH17s1eRo5H7fhcCryJJeYujUA=; b=OZ0ZafBagH4vGQukLWG/5tHllIClw QOzLzg2bw80ppT8fM7E1176TCn39KoFW287hQOCeMmGCRtqr+Z3UuYb0M0TEDEc1 SlEI5GR8WY2M4BsRGgCYOttbQJYyj4s24zBrOElf+REGmECLlDk4n/WtfvQwH35b JgPtI4Q+MoxP72rhcB/gUrU/hNQn8Mk6x5v9aTZnyP+4wUKUEVudt7/a5psLjAJo z+mTIQEji/LXcTPIPQ6EoEsP9lTrb6aeSxesAUYkzOT5XsOtP8i/XsvnlpIWZNXb EfKqZgaZpLdsSBbhzsOCRzBys9AXrE1sYoeCQF30rKyoITbo5m9tu3+AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=LPpFR6eGDnIi7yiQq rH17s1eRo5H7fhcCryJJeYujUA=; b=opfcATzg/76dPZZxCrppyacVQEqBl5EY3 zkd1rytx5CxRQDQ06fAC4+HuTDwGxoNtIBT3tBDyQnX9Aag4KZmSCmMgw4Wl1bp0 eMQzpEF3Nq4fw7ylTPiPoh0WWdH9wTm+W1dfmFzK9lqAzk98Jdab14SR7qFb4Fn6 zj5+4TLvlZhfOToP5ggdgjp5AbgTp3zGlUvVXiMBipa7QwrdJbZqLbUpv23101p2 cllxlXLu80DPMsJsmLYV1xVQHdpKmJD4fWh3oerJbyxrWHtS/T6cKLsvy8scVWXl JxCXBx06rF7DFL/i03ZgPy3E4OfcUZ4CtQdPIIUn16A91tv7MnxQg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeifedgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdektddtre dttdenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdr shhhrghhrghfrdhnrghmvgeqnecuggftrfgrthhtvghrnhepfffhgeettdeukeeuhfduvd ejveeftdekteejtedvhffhgeekvefgvedtleffgeefnecukfhppeejledrudekvddrfeei rddukedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Received: from tarpaulin.shahaf.local2 (bzq-79-182-36-181.red.bezeqint.net [79.182.36.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 23F441080064 for ; Wed, 31 Mar 2021 20:00:30 -0400 (EDT) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4F9jxS0qdJz3HM; Thu, 1 Apr 2021 00:00:28 +0000 (UTC) From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH 1/2] __arguments: New completion function for _arguments. Date: Thu, 1 Apr 2021 00:00:25 +0000 Message-Id: <20210401000026.23570-1-danielsh@tarpaulin.shahaf.local2> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Seq: 48361 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: In the penultimate paragraph of the comment, the two possibilities for the relative path cover three cases: - The comment is read in the source tree - The comment is read in an installed tree with --enable-function-subdirs - The comment is read in an installed tree with --disable-function-subdirs Review-by: Matthew Martin --- Completion/Zsh/Function/__arguments | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Completion/Zsh/Function/__arguments diff --git a/Completion/Zsh/Function/__arguments b/Completion/Zsh/Function/__arguments new file mode 100644 index 000000000..40a4e4b60 --- /dev/null +++ b/Completion/Zsh/Function/__arguments @@ -0,0 +1,44 @@ +#compdef _arguments + +# Dear reader: This function is called "__arguments" and is the completion +# function for the completion function _arguments. This function, however, is +# not the completion function _arguments. If you're looking for the function +# _arguments, then you've come to the wrong place. +# +# _arguments is a completion utility function. It is called by completion +# functions for command-line tools. +# +# __arguments is a completion function for _arguments. It runs when one does +# `_arguments -' at the shell prompt to jog one's memory about _arguments' +# option flags. +# +# _arguments is in documented in the manual. If you were looking for its +# source code, that'd be either in ../../../Completion/Base/Utility/_arguments +# or in ./_arguments, depending on where you're reading this file. +# +# __arguments takes no arguments. + +if (( ${words[(i)--]} < CURRENT )); then + # "Deriving spec forms from the help output" + _arguments : \ + '*-i[specify option name exclude patterns]:option name exclude pattern' \ + '*-s[specify option aliases]:pattern and replacement as "(this that)"' \ + '*:helpspec (pattern\:message\:action)' +else + _arguments -A '-*' : \ + '-n[set $NORMARG]' \ + '-s[enable single-letter option stacking (-x -y == -xy)]' \ + '-w[(rarely needed) enable single-letter option stacking with arguments (-x X -y == -xy X)]' \ + '-W[(rarely needed) enable single-letter option stacking with arguments in the same word (-x X -y == -xXy)]' \ + "-C[modify \$curcontext for \`->action' (requires \`local curcontext')]" \ + "-R[when \`->action' matches, return 300]" \ + "-S[honour \`--' as end-of-options guard]" \ + "-A[do not complete options after non-options]:pattern matching unknown options (e.g., '-*')" \ + '-O[pass elements of array variable to function calls in actions]:array variable name:_parameters -g array' \ + "-M[specify matchspec for completing option names and values]:matchspec for completing option names and values (default\\: 'r\\:|[_-]=* r\\:|=*')" \ + '-0[have ${(v)opt_args} be NUL-joined rather than colon-escaped and colon-joined]' \ + "--[derive optspecs from \`\${command} --help' output]" \ + '1::optional delimiter:(\:)' \ + '*:spec (e.g., "*(-t --to)"{-t+,--to=}"[specify recipient]\:recipient'\''s address\:_email_addresses)' + # TODO: doesn't support "Specifying Multiple Sets of Arguments" +fi