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

Re: old or new style completion?



On Sat, 29 Sep 2007, Clint Adams wrote:

2) whether i declare "cpv" as an alias or a function, the completion system "interprets it" as the command is rsync, not cpv. if there's no way around that it seems like a problem with the completion system... no?

You are incorrect.  Try cpv() { rsync "$@" }

You will not get rsync completion unless you do a "compdef _rsync cpv". You could demand cp-like completion instead with "compdef _cp cpv", though that would not be useful. If you are witnessing different results, perhaps you still have your alias set.
=====================

yeah, i still had the alias defined; now it works fine as a function. since cpv is rsync, but neutered to the point of only copying to/from the local system i wouldn't want "compdef _rsync cpv", and i'm not even sure i need "compdef _cp cpv", since the default of auto-completing directories and files seems to work fine.


--
        ...atom

 ________________________
 http://atom.smasher.org/
 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
 -------------------------------------------------

	"Facts are stupid things."
		-- Ronald Reagan (1988)




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