From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21398 invoked by alias); 22 Dec 2014 20:46:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34042 Received: (qmail 19236 invoked from network); 22 Dec 2014 20:45:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=x-sasl-enc:date:from:to:subject:message-id :mime-version:content-type; s=mesmtp; bh=/i7z1sDJOf91ycaXdjBDEMF +lkY=; b=UtJeZnK7TU8CMcq9oO8UgWxtBFpNum7+sbBFQ2RgPyHQX5W8ohrzAyI iw0g/OBTtTlaXvjsdpsu7u0QyNoRGnaULWtekM6rnF7ucM/NiN3TI/XrWXztID6s iJrBFJiJlzPn6OG69sP1fFIq7Yh34ajSPNn7gZvyLUOMeZ8bENsU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:subject :message-id:mime-version:content-type; s=smtpout; bh=/i7z1sDJOf9 1ycaXdjBDEMF+lkY=; b=C3DK9ub0kkwa4Ol6smV6TE5gVgoG+V4g7ll2H5tRo7t 72Qs48MhmuVeib9WZA6MpMFpsqSWnnC9KrHXjxPHC5Jynl9t7CcM7XbDBx4dpjyN OS0WTsjsysTaLuROq4VWw+CMwabgEiTfBFgfex86VgdlZN5PaJPkaMTha6zzojV8 = X-Sasl-enc: nstmQXFQJhfe5v/tmg/NjZsk7cr8janK06wDGOvsSHWF 1419281148 Date: Mon, 22 Dec 2014 20:45:46 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH] _git: Respect tags for subcommand completion. Message-ID: <20141222204546.GC15399@tarsus.local2> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Attached a patch to improve the 'git ' user experience. Daniel --J2SCkAp4GZ/dPZZf Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-_git-Respect-tags-for-subcommand-completion.patch" >>From 6c5bc94d11ddf516188fb96f2cf16b15991f8f5f Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 16 Dec 2014 23:43:28 +0000 Subject: [PATCH] _git: Respect tags for subcommand completion. It is now possible to use the tag-order style to stagger the overwhelming 'git ' subcommand listing. For example: zstyle ':completion::complete:git:argument-1:' tag-order \ main-porcelain-commands user-commands third-party-commands \ ancillary-manipulator-commands ancillary-interrogator-commands \ plumbing-manipulator-commands plumbing-interrogator-commands \ aliases --- Completion/Unix/Command/_git | 68 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 8fcfc15..bdb58e5 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5206,20 +5206,60 @@ _git_commands () { integer ret=1 - # TODO: Is this the correct way of doing it? Should we be using _alternative - # and separate functions for each set of commands instead? - _describe -t aliases alias unique_aliases && ret=0 - _describe -t main-porcelain-commands 'main porcelain command' main_porcelain_commands && ret=0 - _describe -t user-commands 'user command' user_commands && ret=0 - _describe -t third-party-commands 'third-party command' third_party_commands && ret=0 - _describe -t ancillary-manipulator-commands 'ancillary manipulator command' ancillary_manipulator_commands && ret=0 - _describe -t ancillary-interrogator-commands 'ancillary interrogator command' ancillary_interrogator_commands && ret=0 - _describe -t interaction-commands 'interaction command' interaction_commands && ret=0 - _describe -t plumbing-manipulator-commands 'plumbing manipulator command' plumbing_manipulator_commands && ret=0 - _describe -t plumbing-interrogator-commands 'plumbing interrogator command' plumbing_interrogator_commands && ret=0 - _describe -t plumbing-sync-commands 'plumbing sync command' plumbing_sync_commands && ret=0 - _describe -t plumbing-sync-helper-commands 'plumbing sync helper command' plumbing_sync_helper_commands && ret=0 - _describe -t plumbing-internal-helper-commands 'plumbing internal helper command' plumbing_internal_helper_commands && ret=0 + _tags \ + aliases \ + main-porcelain-commands \ + user-commands \ + third-party-commands \ + ancillary-manipulator-commands \ + ancillary-interrogator-commands \ + interaction-commands \ + plumbing-manipulator-commands \ + plumbing-interrogator-commands \ + plumbing-sync-commands \ + plumbing-sync-helper-commands \ + plumbing-internal-helper-commands + + while _tags; do + + _requested aliases && \ + _describe -t aliases 'alias' unique_aliases && ret=0 + + _requested main-porcelain-commands && \ + _describe -t main-porcelain-commands 'main porcelain command' main_porcelain_commands && ret=0 + + _requested user-commands && \ + _describe -t user-commands 'user command' user_commands && ret=0 + + _requested third-party-commands && \ + _describe -t third-party-commands 'third-party command' third_party_commands && ret=0 + + _requested ancillary-manipulator-commands && \ + _describe -t ancillary-manipulator-commands 'ancillary manipulator command' ancillary_manipulator_commands && ret=0 + + _requested ancillary-interrogator-commands && \ + _describe -t ancillary-interrogator-commands 'ancillary interrogator command' ancillary_interrogator_commands && ret=0 + + _requested interaction-commands && \ + _describe -t interaction-commands 'interaction command' interaction_commands && ret=0 + + _requested plumbing-manipulator-commands && \ + _describe -t plumbing-manipulator-commands 'plumbing manipulator command' plumbing_manipulator_commands && ret=0 + + _requested plumbing-interrogator-commands && \ + _describe -t plumbing-interrogator-commands 'plumbing interrogator command' plumbing_interrogator_commands && ret=0 + + _requested plumbing-sync-commands && \ + _describe -t plumbing-sync-commands 'plumbing sync command' plumbing_sync_commands && ret=0 + + _requested plumbing-sync-helper-commands && \ + _describe -t plumbing-sync-helper-commands 'plumbing sync helper command' plumbing_sync_helper_commands && ret=0 + + _requested plumbing-internal-helper-commands && \ + _describe -t plumbing-internal-helper-commands 'plumbing internal helper command' plumbing_internal_helper_commands && ret=0 + + (( ret )) || break + done return ret } -- 1.9.1 --J2SCkAp4GZ/dPZZf--