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

Re: GNU diff completion problem



On Mar 9,  7:45pm, Andrej Borsenkow wrote:
} Subject: GNU diff completion problem
}
} I'm sorry, but I missed this discussion.
} 
} Why _diff_options tests diff and not real command ($word[1])?

It's in case the real command is an alias or function that has unknown
side-effects.

} I have system default diff and GNU diff as gdiff. Current state does not
} allow me to complete GNU diff at all

You want

    compdef _diff gdiff
    zstyle ':completion:*:*:gdiff:*:version' command gdiff -v

There's still a bug in that the next time you use plain `diff' the saved
value of _diff_is_gnu will cause GNU diff options to be completed.  The
value of "_is_gnu" should probably be saved on a per-command basis.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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