19 #include "parser_local_proto.h" 22 static void print_escaped_for_rest(FILE * f,
const char *str);
23 static void print_escaped_for_rest_options(FILE * f,
const char *str);
44 fprintf(stdout,
"=================");
45 for (s = 0; s <= strlen(
st->pgm_name); s++) {
48 fprintf(stdout,
"\n");
49 fprintf(stdout,
"%s - GRASS GIS manual\n",
st->pgm_name);
50 fprintf(stdout,
"=================");
51 for (s = 0; s <= strlen(
st->pgm_name); s++) {
54 fprintf(stdout,
"\n\n");
56 fprintf(stdout,
".. figure:: grass_logo.png\n");
57 fprintf(stdout,
" :align: center\n");
58 fprintf(stdout,
" :alt: GRASS logo\n\n");
60 fprintf(stdout,
"%s\n----\n",
_(
"NAME"));
61 fprintf(stdout,
"**%s**",
st->pgm_name);
63 if (
st->module_info.label ||
st->module_info.description)
64 fprintf(stdout,
" - ");
66 if (
st->module_info.label)
67 fprintf(stdout,
"%s\n\n",
st->module_info.label);
69 if (
st->module_info.description)
70 fprintf(stdout,
"%s\n",
st->module_info.description);
73 fprintf(stdout,
"\n%s\n----------------------\n",
_(
"KEYWORDS"));
74 if (
st->module_info.keywords) {
76 fprintf(stdout,
"\n");
78 fprintf(stdout,
"\n%s\n----------------------\n",
_(
"SYNOPSIS"));
79 fprintf(stdout,
"**%s**\n\n",
st->pgm_name);
80 fprintf(stdout,
"**%s** --help\n\n",
st->pgm_name);
82 fprintf(stdout,
"**%s**",
st->pgm_name);
88 flag = &
st->first_flag;
89 fprintf(stdout,
" [**-");
90 while (flag !=
NULL) {
91 fprintf(stdout,
"%c", flag->
key);
94 fprintf(stdout,
"**] ");
100 opt = &
st->first_option;
102 while (opt !=
NULL) {
121 fprintf(stdout,
" [");
122 fprintf(stdout,
"**%s** = *%s*", opt->
key, type);
124 fprintf(stdout,
" [, *%s* ,...]", type);
127 fprintf(stdout,
"] ");
130 fprintf(stdout,
" ");
134 fprintf(stdout,
" [-- **overwrite**] ");
136 fprintf(stdout,
" [-- **verbose**] ");
137 fprintf(stdout,
" [-- **quiet**] ");
139 fprintf(stdout,
"\n");
143 fprintf(stdout,
"\n");
144 if (
st->n_flags || new_prompt) {
145 flag = &
st->first_flag;
146 fprintf(stdout,
"%s:\n~~~~~~\n",
_(
"Flags"));
147 while (
st->n_flags && flag !=
NULL) {
148 fprintf(stdout,
"**-%c**\n", flag->
key);
151 fprintf(stdout,
" %s", flag->
label);
159 fprintf(stdout,
"\n");
162 fprintf(stdout,
"-- **overwrite**\n");
163 fprintf(stdout,
" %s\n",
164 _(
"Allow output files to overwrite existing files"));
167 fprintf(stdout,
"-- **verbose**\n");
168 fprintf(stdout,
" %s\n",
_(
"Verbose module output"));
170 fprintf(stdout,
"-- **quiet**\n");
171 fprintf(stdout,
" %s\n",
_(
"Quiet module output"));
173 fprintf(stdout,
"\n");
176 fprintf(stdout,
"\n");
178 opt = &
st->first_option;
179 fprintf(stdout,
"%s:\n~~~~~~~~~~~\n",
_(
"Parameters"));
181 while (opt !=
NULL) {
200 fprintf(stdout,
"**%s** = *%s*", opt->
key, type);
202 fprintf(stdout,
" [, *%s* ,...]", type);
206 fprintf(stdout,
" **[required]**");
208 fprintf(stdout,
"\n\n");
210 fprintf(stdout,
"\t");
211 print_escaped_for_rest(stdout, opt->
label);
213 fprintf(stdout,
"\n\n");
216 fprintf(stdout,
"\t");
219 fprintf(stdout,
"\n\n");
223 fprintf(stdout,
"\t%s: *",
_(
"Options"));
224 print_escaped_for_rest_options(stdout, opt->
options);
226 fprintf(stdout,
"*\n\n");
230 fprintf(stdout,
"\t%s:",
_(
"Default"));
233 fprintf(stdout,
" *");
234 print_escaped_for_rest(stdout, opt->
def);
236 fprintf(stdout,
"*\n\n");
238 fprintf(stdout,
"\n\n");
244 while (opt->
opts[i]) {
246 fprintf(stdout,
"\t\t**");
247 print_escaped_for_rest(stdout, opt->
opts[i]);
249 fprintf(stdout,
"** : ");
250 print_escaped_for_rest(stdout, opt->
descs[i]);
252 fprintf(stdout,
"\n\n");
259 fprintf(stdout,
"\n");
261 fprintf(stdout,
"\n");
270 #define do_escape(c,escaped) case c: fputs(escaped,f);break 271 void print_escaped_for_rest(FILE * f,
const char *str)
275 for (s = str; *s; s++) {
284 void print_escaped_for_rest_options(FILE * f,
const char *str)
288 for (s = str; *s; s++) {
int G__uses_new_gisprompt(void)
const char * G_program_name(void)
Return module name.
#define do_escape(c, escaped)
Format text for reStructuredText output.
void G__usage_rest(void)
Print module usage description in reStructuredText format.
Structure that stores flag info.
Structure that stores option information.
void G__print_keywords(FILE *fd, void(*format)(FILE *, const char *))
Print list of keywords (internal use only)