Index: subversion/libsvn_subr/opt.c =================================================================== --- subversion/libsvn_subr/opt.c (revision 28528) +++ subversion/libsvn_subr/opt.c (working copy) @@ -252,32 +252,32 @@ } } /* And global options too */ - if (global_options) - for (i = 0; global_options[i]; i++) - { - if (have_options == FALSE) - { - SVN_ERR(svn_cmdline_fputs(_("\nValid options:\n"), - stream, pool)); - have_options = TRUE; - } + if (global_options && *global_options) + { + SVN_ERR(svn_cmdline_fputs(_("\nGlobal options:\n"), + stream, pool)); + have_options = TRUE; - /* convert each option code into an option */ - option = - svn_opt_get_option_from_code2(global_options[i], - options_table, - cmd, pool); - - /* print the option's docstring */ - if (option) - { - const char *optstr; - svn_opt_format_option(&optstr, option, TRUE, pool); - SVN_ERR(svn_cmdline_fprintf(stream, pool, " %s\n", - optstr)); - } - } - + for (i = 0; global_options[i]; i++) + { + + /* convert each option code into an option */ + option = + svn_opt_get_option_from_code2(global_options[i], + options_table, + cmd, pool); + + /* print the option's docstring */ + if (option) + { + const char *optstr; + svn_opt_format_option(&optstr, option, TRUE, pool); + SVN_ERR(svn_cmdline_fprintf(stream, pool, " %s\n", + optstr)); + } + } + } + if (have_options) SVN_ERR(svn_cmdline_fprintf(stream, pool, "\n")); } Index: subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout =================================================================== --- subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (revision 28528) +++ subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (working copy) @@ -46,6 +46,8 @@ --changelist ARG : operate only on members of changelist ARG --with-all-revprops : retrieve all revision properties --with-revprop ARG : retrieve revision property ARG + +Global options: --username ARG : specify a username ARG --password ARG : specify a password ARG --no-auth-cache : do not cache authentication tokens @@ -98,6 +100,8 @@ --accept ARG : specify automatic conflict resolution action ('postpone', 'base', 'mine', 'theirs', 'edit', 'launch') + +Global options: --username ARG : specify a username ARG --password ARG : specify a password ARG --no-auth-cache : do not cache authentication tokens