Christian Ferbar wrote: > new version. This patch are my current changes for "svn ls" only.
Thanks, Chris. This looks much better already. (I haven't tried it.) > I need some feedback concerning: > > -> how to deal with svn error messages written to stderr, for example: > svn ls svn+ssh://svn.something.com/<tab><tab>u...@svn.something.com's > password: > > this happens when you forget to do ssh-add I suggest it should simply not provide any completions that cannot be obtained without further input. Use --non-interactive so that Subversion does not prompt for passwords. Prevent any stderr output being printed to the console (maybe use "2> /dev/null"). Then make sure the script behaves OK (just returning no completions) when Subversion returns an error. You might need to look for a non-zero exit code explicitly, but maybe not: it might be enough to just try parsing the stdout and if there is no recognizable stdout then you get no resulting completions. > -> in bash >= 4 they changed COMP_WORDS. The Line will be split at : as well, > so "file:/something" are 3 array items. Nobody would use subversion 1.9 with > bash 3 ... probably. I will drop bash 3 statements, for example: > > if [[ $cur == file:* ]] > > ok? Dropping support for Bash 3 sounds OK to me, if it is difficult to keep it working. Especially good if only the URL completion depends on Bash 4 and all the rest of the existing kinds of completion keep working with Bash 3. >> Please can URL completion work on full URLs as well as on relative URLs? > for SVN LS this is done: > > 1. svn ls tabtab -> ^/ file:/// http:// https:// > svn:// svn+ssh:// > 2. svn ls svn+ssh://tabtab -> will look at the ~/.ssh/known_hosts > 3. svn ls http[s]://tabtab -> lookup in ~/.subversion/simple-auth > - should still be working > 4. svn ls proto://server/tabtab or ^/tabtab -> autocomplete via "svn ls" Excellent, that looks like the sort of thing I was hoping for. - Julian