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

Re: complete as some other sub command



> On 04/11/2024 16:42 GMT Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
> 
> 
> Hello, is it possible to make a function to inherit the completion contest of another sub command? in my case i would like to make the function gd complete as it was "git diff"

The simple way is

autoload -X _git   # fails if _git is already loaded, harmless
compdef _git-diff gd

Others may be able to think of gotchas requiring something a bit
more sophisticated.

pws




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