jim_getopt_nvp_unknown() is only used within OpenOCD.
 
Symbols
loading...
Files
loading...
CodeScopeDevelopment ToolsOpenOCDjim_getopt_nvp_unknown()

jim_getopt_nvp_unknown() function

Create an appropriate error message for an NVP. This function will set the "interp->result" to a human readable error message listing the available options. This function assumes the previous option argv[-1] is the unknown string. If this option had some prefix, then pass "hadprefix = 1" else pass "hadprefix = 0" Example: \code while (goi.argc) { // Get the next option e = jim_getopt_nvp(&goi, cmd_options, &n); if (e != JIM_OK) { // option was not recognized // pass 'hadprefix = 0' because there is no prefix jim_getopt_nvp_unknown(&goi, cmd_options, 0); return e; } switch (n->value) { case OPT_SEX: // handle: --sex male | female | lots | needmore e = jim_getopt_nvp(&goi, &nvp_sex, &n); if (e != JIM_OK) { jim_getopt_nvp_unknown(&ogi, nvp_sex, 1); return e; } printf("Code: (%d) is %s\n", n->value, n->name); break; case ...: [snip] } } \endcode

Syntax

void jim_getopt_nvp_unknown(struct jim_getopt_info *goi,     const struct jim_nvp *lookup,     int hadprefix);
Implemented in jim-nvp.c:252

Arguments

goi

- options info

lookup

- the NVP table that was used.

hadprefix

- 0 or 1 if the option had a prefix.

References

LocationReferrerText
jim-nvp.c:252
void jim_getopt_nvp_unknown(struct jim_getopt_info *goi, const struct jim_nvp *nvptable, int hadprefix)
jim-nvp.h:292
void jim_getopt_nvp_unknown(struct jim_getopt_info *goi, const struct jim_nvp *lookup, int hadprefix);
arm_dap.c:211dap_configure()
jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
arm_tpiu_swo.c:379arm_tpiu_swo_configure()
jim_getopt_nvp_unknown(goi, nvp_arm_tpiu_swo_config_opts, 0);
arm_tpiu_swo.c:513arm_tpiu_swo_configure()
jim_getopt_nvp_unknown(goi, nvp_arm_tpiu_swo_event, 1);
target.c:5044target_configure()
jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
target.c:5075target_configure()
jim_getopt_nvp_unknown(goi, nvp_target_event, 1);
target.c:5217target_configure()
jim_getopt_nvp_unknown(goi, nvp_target_endian, 1);
target.c:5613jim_target_invoke_event()
jim_getopt_nvp_unknown(&goi, nvp_target_event, 1);

Call Tree

Functions calling jim_getopt_nvp_unknown()
Functions called by jim_getopt_nvp_unknown()
jim_getopt_nvp_unknown()
all items filtered out
Data read by jim_getopt_nvp_unknown()
jim_getopt_nvp_unknown()