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=0.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RDNS_NONE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.4 Received: from authenticated user by zero.zsh.org with local id 1kiXxY-0001RU-UR; Fri, 27 Nov 2020 07:14:24 +0000 Authentication-Results: zsh.org; iprev=pass (relay4-d.mail.gandi.net) smtp.remote-ip=217.70.183.196; dmarc=none header.from=chazelas.org; arc=none Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35365) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1kiXx9-0001D7-Ts; Fri, 27 Nov 2020 07:14:01 +0000 X-Originating-IP: 94.10.124.211 Received: from chazelas.org (unknown [94.10.124.211]) (Authenticated sender: stephane@chazelas.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 5FEB5E0002 for ; Fri, 27 Nov 2020 07:13:58 +0000 (UTC) Date: Fri, 27 Nov 2020 07:13:57 +0000 From: Stephane Chazelas To: Zsh hackers list Subject: Re: [PATCH] ulimit option completions using ulimit -a output Message-ID: <20201127071357.kifmnsmf45f6vkw3@chazelas.org> Mail-Followup-To: Zsh hackers list References: <20201123214942.hi2rx7n3jk25ucmd@chazelas.org> <74327-1606347813.918593@HxCz.NV4p.AwzH> <20201126201431.a6ym56gcagomyvzk@chazelas.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126201431.a6ym56gcagomyvzk@chazelas.org> X-Seq: 47661 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: 2020-11-26 20:14:31 +0000, Stephane Chazelas: [...] > The problem is that the list of ulimit options is system > dependent, so I propose the improvement below which uses the > output of ulimit -a to build the list of completions. [...] > +++ b/Completion/Zsh/Command/_ulimit [...] > '-S[set soft and hard limits (with -H)]' \ [...] > + '-N+[specify limit by number]:limit number' \ [...] > + '*:file size (blocks)' [...] Sorry, should have been '-N+[specify limit by number]:limit number::limit value' Otherwise you'd get "Completing file size (blocks)" when pressing Tab after "ulimit -N 15 ". Now I need to figure out how to amend a commit that is not the latest... By the way, should I cache that list of options retrieved from the output of "ulimit -a"? After all, it's not going to change from one run to the next. But then again, a $(ulimit -a) command substitution is going to be fast and caching uses up memory. Do you have recommendations as to when to cache and when not to? -- Stephane