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

Re: Command Completion



On Sep 11,  1:55pm, Nick Cross wrote:
}
} https://github.com/defunkt/hub/blob/master/etc/hub.zsh_completion
} 
} Ideally I would like to use the hub binary command to complete standard 
} git commands plus the extra commands it provides (e.g. pull-request). 

I suggest you start by looking at Completion/Unix/Command/_git, more
specifically the function _git_commands.  I don't know the answer to
the comment it poses at the end (about _alternative vs. the stack of
calls to _describe) but I suspect you could add one more _describe -t
with the hub commands.

To avoid mucking with _git_commands, just use a wrapper that ends with
something like

local ret=1
_git_commands && ret=0
_describe -t hub-extra-commands 'extra command from hub project' ... \
	&& ret=0
return ret

(where "..." is what you fill in).



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