|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
Go to the source code of this file.
Functions | |
| void | mrtk_normalize_args (int argc, char **argv, const mrtk_optmap_t *map) |
| Translate --long flags to their -short aliases in argv (in place). | |
| int | mrtk_is_help_flag (const char *arg) |
| Returns 1 if arg is a generic help flag (-h or --help), else 0. | |
| int mrtk_is_help_flag | ( | const char * | arg | ) |
Returns 1 if arg is a generic help flag (-h or --help), else 0.
Subcommands that have repurposed -h (e.g. post uses it for fix-and-hold AR) must NOT use this helper and should match --help (and any historical short flag like -?) manually.
| [in] | arg | argument string (must not be NULL) |
Definition at line 30 of file mrtk_cli.c.
| void mrtk_normalize_args | ( | int | argc, |
| char ** | argv, | ||
| const mrtk_optmap_t * | map ) |
Translate --long flags to their -short aliases in argv (in place).
Walks argv[1..argc-1] and, for each entry that exactly matches a map[i].long_opt, swaps the pointer to point at map[i].short_opt instead. Only the argv pointers are reassigned; the underlying argument strings are never mutated. argv[0] is left untouched. Pass NULL or an empty map to no-op.
| [in] | argc | argument count |
| [in,out] | argv | argument vector (pointers may be reassigned) |
| [in] | map | NULL-terminated alias table (terminator: {NULL, NULL}) |
Definition at line 12 of file mrtk_cli.c.
References mrtk_optmap_t::long_opt.