Parse the Command Line. More...
#include "config.h"#include <getopt.h>#include <stdbool.h>#include <string.h>#include <sys/param.h>#include <unistd.h>#include "mutt/lib.h"#include "objects.h"
Include dependency graph for parse.c:Go to the source code of this file.
Functions | |
| int | check_help_mode (const char *mode) |
| Check for help mode. | |
| static int | mop_up (int argc, char *const *argv, int index, struct StringArray *sa) |
| Eat multiple arguments. | |
| bool | cli_parse (int argc, char *const *argv, struct CommandLine *cli) |
| Parse the Command Line. | |
Variables | |
| static const struct option | LongOptions [] |
| Long option definitions for getopt_long() | |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file parse.c.
| int check_help_mode | ( | const char * | mode | ) |
Check for help mode.
| mode | String to check |
| enum | HelpMode, e.g. HM_CONFIG |
Definition at line 96 of file parse.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Eat multiple arguments.
| [in] | argc | Size of argument array |
| [in] | argv | Array of argument strings |
| [in] | index | Where to start eating |
| [out] | sa | Array for the results |
| num | Number of arguments eaten |
Some options, like -A, can take multiple arguments. e.g. -A apple or -A apple banana cherry
Copy the arguments into an array.
Definition at line 126 of file parse.c.
Here is the call graph for this function:
Here is the caller graph for this function:| bool cli_parse | ( | int | argc, |
| char *const * | argv, | ||
| struct CommandLine * | cli ) |
| [in] | argc | Number of arguments |
| [in] | argv | Arguments |
| [out] | cli | Results |
| true | Success |
Definition at line 148 of file parse.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Long option definitions for getopt_long()
All short options have corresponding long options for clarity. The syntax is backwards compatible - all original short options work.
Definition at line 44 of file parse.c.