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

Re: rsync --progress stops completion



On Sep 22, 12:29am, Yuri D'Elia wrote:
}
} It remains to be seen if this is any better than just using the _files
} completer. My guess is that it would generally be, though it might break
} too easily for programs that have positional arguments.

It's probably going to be really bad for programs that have subcommands
(e.g., git) because it's going to throw away the subcommand name.  One
possibility would be to try repeatedly, throwing away one word at a
time, e.g.:

    while (( --CURRENT > 1 ))
    do
	words[CURRENT]=()
	_complete && return 0
    done

That preserves as much of the context as possible for each attempt, at
the cost of some potential wasted cycles.



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