The bash completion does not use the content of 'svn help'
AFAIK. (we're talking about the script in tools/client-side/ right?).

...

I had not thought of using svn help output to feed the completion
though, that sounds quite a neat idea. Are you willing to work on it
(you seemed to use zsh rather than bash though) ? Or do you know
existing examples of such bash scripts that could be a basis for an
svn one ?

Here is a step towards that.
After I fixed a trivial bug in bash_completion and added recognition of "--arg=value", I wrote a test script that (among other tests) checks the completions against "svn help". That showed me lots more bugs. So here are the fixes and the test script (which is not run automatically by "make check").
Note: the test script still fails for one reason: "--version" is described by "svn help" as an option to "svn help". That is wrong: it doesn't work like that, though it is sort of internally handled that way. "--version" and "--help" and "-h" are (should be) options to "svn" (without a subcommand). I regard this as a bug in "svn", not in "bash_completion" or "bash_completion_test".
I could adjust bash_completion and/or bash_completion_test to overlook this anomoly if you really want. It should be marked "XFAIL" but that's not easy to do. This is what it says:
~/src/subversion/tools/client-side> ./bash_completion_test ./bash_completion
Checking general completion
Checking list of subcommands
Checking list of options for each subcommand
FAIL: completions for "svn ? -" != options accepted
(completions: --quiet -q )
(svn accepts: --quiet --version -q )
FAIL: completions for "svn h -" != options accepted
(completions: --quiet -q )
(svn accepts: --quiet --version -q )
FAIL: completions for "svn help -" != options accepted
(completions: --quiet -q )
(svn accepts: --quiet --version -q )
Checking rejection of synonyms
FAILURE: at least one bash_completion test failed.
Is this acceptable the way it is, given that the test script is only to be run manually by someone who is interested in bash_completion?
- Julian
Log message:
Improve and fix bash_completion.
Add a script that tests bash_completion, including checking the completion
results against the output of "svn help [...]".
* tools/client-side/bash_completion
(_svn) Recognise "--arg=value" as an alternative to "--arg value" (when
excluding options or synonyms that are already present).
Fix the list of subcommands and options accepted as a first argument.
Fix the lists of options accepted by various subcommands.
* tools/client-side/bash_completion_test
New file: a shell script that tests bash_completion.