version 1.69, 2014/04/17 14:45:49 |
version 1.70, 2014/09/01 21:50:18 |
|
|
|
|
/* Set user option. */ |
/* Set user option. */ |
enum cmd_retval |
enum cmd_retval |
cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr, |
cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char *optstr, |
const char *valstr) |
const char *valstr) |
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
|
|
if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) { |
if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) { |
if (!args_has(args, 'q')) { |
if (!args_has(args, 'q')) { |
cmdq_error(cmdq, "already set: %s", optstr); |
cmdq_error(cmdq, "already set: %s", optstr); |
return CMD_RETURN_ERROR; |
return (CMD_RETURN_ERROR); |
} |
} |
return (CMD_RETURN_NORMAL); |
return (CMD_RETURN_NORMAL); |
} |
} |