GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-57a646b4a4
|
GIS Library - Argument parsing functions (help) More...
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "parser_local_proto.h"
Go to the source code of this file.
Functions | |
void | G_usage (void) |
Command line help/usage message. More... | |
void | G__usage_text (void) |
GIS Library - Argument parsing functions (help)
(C) 2001-2009, 2011 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file parser_help.c.
void G__usage_text | ( | void | ) |
Definition at line 53 of file parser_help.c.
void G_usage | ( | void | ) |
Command line help/usage message.
Calls to G_usage() allow the programmer to print the usage message at any time. This will explain the allowed and required command line input to the user. This description is given according to the programmer's definitions for options and flags. This function becomes useful when the user enters options and/or flags on the command line that are syntactically valid to the parser, but functionally invalid for the command (e.g. an invalid file name.)
For example, the parser logic doesn't directly support grouping options. If two options be specified together or not at all, the parser must be told that these options are not required and the programmer must check that if one is specified the other must be as well. If this additional check fails, then G_parser() will succeed, but the programmer can then call G_usage() to print the standard usage message and print additional information about how the two options work together.
Definition at line 48 of file parser_help.c.