void svn_opt_print_generic_help2(const char *header, const svn_opt_subcommand_desc2_t *cmd_table, const apr_getopt_option_t *opt_table, const char *footer, apr_pool_t *pool, FILE *stream) { int i = 0; svn_error_t *err; if (header) if ((err = svn_cmdline_fputs(header, stream, pool))) goto print_error; while (cmd_table[i].name) { if ((err = svn_cmdline_fputs(" ", stream, pool)) || (err = print_command_info2(cmd_table + i, opt_table, NULL, FALSE, pool, stream)) || (err = svn_cmdline_fputs("\n", stream, pool))) goto print_error; i++; } if ((err = svn_cmdline_fputs("\n", stream, pool))) goto print_error; if (footer) if ((err = svn_cmdline_fputs(footer, stream, pool))) goto print_error; return; print_error: /* Issue #3014: * Don't print anything on broken pipes. The pipe was likely * closed by the process at the other end. We expect that * process to perform error reporting as necessary. * * ### This assumes that there is only one error in a chain for * ### SVN_ERR_IO_PIPE_WRITE_ERROR. See svn_cmdline_fputs(). */ if (err->apr_err != SVN_ERR_IO_PIPE_WRITE_ERROR) svn_handle_error2(err, stderr, FALSE, "svn: "); svn_error_clear(err); }
void svn_opt_print_generic_help2(const char *header, const svn_opt_subcommand_desc2_t *cmd_table, const apr_getopt_option_t *opt_table, const char *footer, apr_pool_t *pool, FILE *stream) { int i = 0; svn_error_t *err; if (header) if ((err = svn_cmdline_fputs(header, stream, pool))) goto print_error; while (cmd_table[i].name) { if ((err = svn_cmdline_fputs(" ", stream, pool)) || (err = print_command_info2(cmd_table + i, opt_table, NULL, FALSE, pool, stream)) || (err = svn_cmdline_fputs("\n", stream, pool))) goto print_error; i++; } if ((err = svn_cmdline_fputs("\n", stream, pool))) goto print_error; if (footer) if ((err = svn_cmdline_fputs(footer, stream, pool))) goto print_error; return; print_error: svn_handle_error2(err, stderr, FALSE, "svn: "); svn_error_clear(err); }
void svn_opt_subcommand_help3(const char *subcommand, const svn_opt_subcommand_desc2_t *table, const apr_getopt_option_t *options_table, const int *global_options, apr_pool_t *pool) { const svn_opt_subcommand_desc2_t *cmd = svn_opt_get_canonical_subcommand2(table, subcommand); svn_error_t *err; if (cmd) err = print_command_info2(cmd, options_table, global_options, TRUE, pool, stdout); else err = svn_cmdline_fprintf(stderr, pool, _("\"%s\": unknown command.\n\n"), subcommand); if (err) { svn_handle_error2(err, stderr, FALSE, "svn: "); svn_error_clear(err); } }