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 25183 invoked from network); 13 Nov 2021 23:31:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Nov 2021 23:31:25 -0000 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:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=8qYj2BMKauJvZDHs7aLk+gKAW+MGUNgg/37uMPtk1Cs=; b=S8rxinR/ITga0YUtCo2ZwdGY0E rA0RhuA4ZYU2Bk98jgOjB7XVG7ayOMsjQy8LRCUmSIq+poa2wui7JNhc40mJF1i7Udj4CGIBYdu2h lUo6gHwPn3YO6RzJDcqRKDbVe5QJd5TrkBTJYNsluCw5WGZtzthdaG/6agQEshqRsIfKRVz09o9Yp z37QChgwIehadDqvgu16Qb6ndAvzLRLYyoaZvqcO+VC1ait3kgcwUHqhEJ5vPmR1Sq2BHYNkUGbYS 6AUehzVaXfUpO31X4WrhAJbMLpOMlDJv1ei8dO67ThDHm/GlVQekp1miJK2MNZsEU1sTjwQ6slu28 nKopYX8A==; Received: from authenticated user by zero.zsh.org with local id 1mm2UW-000EL7-7y; Sat, 13 Nov 2021 23:31:24 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mm2UC-000E31-UV; Sat, 13 Nov 2021 23:31:05 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1mm2UB-000FDs-Qz for zsh-workers@zsh.org; Sun, 14 Nov 2021 00:31:03 +0100 From: Oliver Kiddle To: Zsh workers Subject: PATCH: allow for build options in gem completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <58518.1636846263.1@hydra> Date: Sun, 14 Nov 2021 00:31:03 +0100 Message-ID: <58519-1636846263.833647@cweW.gXiU.rB0Q> X-Seq: 49584 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: With a -- argument after gem install, build options can be specified. We can't do much to complete them but completing gems is slow so it is better to be calling _default. I'm sure it was fast enough not to need a cache when _gem was new but it's taking a few seconds now. I've not as yet added that. Oliver diff --git a/Completion/Unix/Command/_gem b/Completion/Unix/Command/_gem index 7e244ccad..7d81619bb 100644 --- a/Completion/Unix/Command/_gem +++ b/Completion/Unix/Command/_gem @@ -56,6 +56,11 @@ if [[ $state = command ]]; then check|cleanup|contents|dependency|list|open|pristine|rdoc|uninstall|unpack|update) args+=( '(--all --skip)*:installed gem:->gems-local' ) ;| + install) + (( ${(M)#line:#[^-]*} > 1 )) && args+=( + '(*)--[specify build options]:*:build option:_default' + ) + ;| fetch|install|lock|owner|search|yank) args+=( '*:gem:->gems-remote' ) ;|