]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/subversion/subversion/svnbench/help-cmd.c
MFC r275385 (by bapt):
[FreeBSD/stable/10.git] / contrib / subversion / subversion / svnbench / help-cmd.c
1 /*
2  * help-cmd.c -- Provide help
3  *
4  * ====================================================================
5  *    Licensed to the Apache Software Foundation (ASF) under one
6  *    or more contributor license agreements.  See the NOTICE file
7  *    distributed with this work for additional information
8  *    regarding copyright ownership.  The ASF licenses this file
9  *    to you under the Apache License, Version 2.0 (the
10  *    "License"); you may not use this file except in compliance
11  *    with the License.  You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  *    Unless required by applicable law or agreed to in writing,
16  *    software distributed under the License is distributed on an
17  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  *    KIND, either express or implied.  See the License for the
19  *    specific language governing permissions and limitations
20  *    under the License.
21  * ====================================================================
22  */
23
24 /* ==================================================================== */
25
26
27 \f
28 /*** Includes. ***/
29
30 #include "svn_string.h"
31 #include "svn_error.h"
32 #include "svn_version.h"
33 #include "cl.h"
34
35 #include "svn_private_config.h"
36
37 \f
38 /*** Code. ***/
39
40 /* This implements the `svn_opt_subcommand_t' interface. */
41 svn_error_t *
42 svn_cl__help(apr_getopt_t *os,
43              void *baton,
44              apr_pool_t *pool)
45 {
46   svn_cl__opt_state_t *opt_state;
47
48   char help_header[] =
49   N_("usage: svnbench <subcommand> [options] [args]\n"
50      "Subversion benchmarking tool.\n"
51      "Type 'svnbench help <subcommand>' for help on a specific subcommand.\n"
52      "Type 'svnbench --version' to see the program version and RA modules\n"
53      "  or 'svnbench --version --quiet' to see just the version number.\n"
54      "\n"
55      "Most subcommands take file and/or directory arguments, recursing\n"
56      "on the directories.  If no arguments are supplied to such a\n"
57      "command, it recurses on the current directory (inclusive) by default.\n"
58      "\n"
59      "Available subcommands:\n");
60
61   char help_footer[] =
62   N_("Subversion is a tool for version control.\n"
63      "For additional information, see http://subversion.apache.org/\n");
64
65   const char *ra_desc_start
66     = _("The following repository access (RA) modules are available:\n\n");
67
68   svn_stringbuf_t *version_footer;
69
70   if (baton)
71     opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
72   else
73     opt_state = NULL;
74
75   version_footer = svn_stringbuf_create(ra_desc_start, pool);
76   SVN_ERR(svn_ra_print_modules(version_footer, pool));
77
78   return svn_opt_print_help4(os,
79                              "svnbench",   /* ### erm, derive somehow? */
80                              opt_state ? opt_state->version : FALSE,
81                              opt_state ? opt_state->quiet : FALSE,
82                              opt_state ? opt_state->verbose : FALSE,
83                              version_footer->data,
84                              help_header,   /* already gettext()'d */
85                              svn_cl__cmd_table,
86                              svn_cl__options,
87                              svn_cl__global_options,
88                              _(help_footer),
89                              pool);
90 }