| 188 | |
| 189 | |
| 190 | int cmdline_get_help_string(cmdline_parse_token_hdr_t *tk, char *dstbuf, |
| 191 | unsigned int size) |
| 192 | { |
| 193 | struct cmdline_token_string *tk2; |
| 194 | struct cmdline_token_string_data *sd; |
| 195 | const char *s; |
| 196 | |
| 197 | if (!tk || !dstbuf) |
| 198 | return -1; |
| 199 | |
| 200 | tk2 = (struct cmdline_token_string *)tk; |
| 201 | sd = &tk2->string_data; |
| 202 | |
| 203 | s = sd->str; |
| 204 | |
| 205 | if (s) { |
| 206 | if (strcmp(s, TOKEN_STRING_MULTI) == 0) |
| 207 | snprintf(dstbuf, size, ANYSTRINGS_HELP); |
| 208 | else if (get_next_token(s)) |
| 209 | snprintf(dstbuf, size, CHOICESTRING_HELP); |
| 210 | else |
| 211 | snprintf(dstbuf, size, FIXEDSTRING_HELP); |
| 212 | } else |
| 213 | snprintf(dstbuf, size, ANYSTRING_HELP); |
| 214 | |
| 215 | return 0; |
| 216 | } |