parrotcode: Command-line option parsing | |
Contents | C |
longopt.c - Command-line option parsing
This is used by parrot
.
PARROT_API int longopt_get(PARROT_INTERP, int argc, NOTNULL(char *argv[]), ARGIN(const struct longopt_opt_decl options[]), NOTNULL(struct longopt_opt_info *info_buf))
options[]
(see docs/dev/longopt.dev).info_buf
until it returns 0 or -1.info_buf->opt_error
.static int longopt_get_longopt(PARROT_INTERP, int argc, NOTNULL(char *argv[]), ARGIN(const struct longopt_opt_decl options[]), NOTNULL(struct longopt_opt_info *info_buf))
info_buf
appropriately,
and return the option identifier.argv[info_buf-
opt_index]> is guaranteed to have at least three characters and start with --
.static int longopt_get_shortopt(PARROT_INTERP, int argc, NOTNULL(char *argv[]), ARGIN(const struct longopt_opt_decl options[]), NOTNULL(struct longopt_opt_info *info_buf))
-abcd
),
and info_buf->_shortopt_pos
maintains a pointer into that bundle.argv[info_buf->opt_index]
is guaranteed to be at least two characters long and start with a dash.include/parrot/longopt.h and docs/dev/longopt.dev.
|