Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: (3/3) _git: re-add `user-commands' support again



Do we really need this style?  I don’t like it at all.  If the user
wants to add completion for a sub-command they should really go the
extra distance and add a proper completion definition for the whole
sub-command.  It’s not hard to add a _git-subcommand file under
~/.zsh/functions (or similar) with a proper description and all.

If you don’t disagree I’m going to remove it.

On Wed, Jun 29, 2011 at 22:37, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> ---
>  Completion/Unix/Command/_git |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
> index ef97499..4567460 100644
> --- a/Completion/Unix/Command/_git
> +++ b/Completion/Unix/Command/_git
> @@ -4439,6 +4439,9 @@ __git_ignore_line_inside_arguments () {
>
>  (( $+functions[_git_commands] )) ||
>  _git_commands () {
> +  local -a user_commands
> +  zstyle -a ":completion:${curcontext}:" user-commands user_commands || user_commands=()
> +
>   local -a main_porcelain_commands
>   main_porcelain_commands=(
>     add:'add file contents to index'
> @@ -4604,6 +4607,7 @@ _git_commands () {
>   _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
>   _describe -t third-party-addons 'third party addon' _git_third_party && ret=0
> +  _describe -t user-specific-commands 'user specific command' user_commands && ret=0
>   return ret
>  }



Messages sorted by: Reverse Date, Date, Thread, Author