version 1.67, 2014/04/17 07:51:38 |
version 1.68, 2014/04/17 07:55:43 |
|
|
return (CMD_RETURN_NORMAL); |
return (CMD_RETURN_NORMAL); |
} |
} |
options_set_string(oo, optstr, "%s", valstr); |
options_set_string(oo, optstr, "%s", valstr); |
if (!args_has(args, 'q')) { |
|
cmdq_info(cmdq, "set option: %s -> %s", optstr, |
|
valstr); |
|
} |
|
} |
} |
return (CMD_RETURN_NORMAL); |
return (CMD_RETURN_NORMAL); |
} |
} |
|
|
} |
} |
|
|
options_remove(oo, oe->name); |
options_remove(oo, oe->name); |
if (!args_has(args, 'q')) |
|
cmdq_info(cmdq, "unset option: %s", oe->name); |
|
return (0); |
return (0); |
} |
} |
|
|
|
|
cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq, |
cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq, |
const struct options_table_entry *oe, struct options *oo, const char *value) |
const struct options_table_entry *oe, struct options *oo, const char *value) |
{ |
{ |
struct args *args = self->args; |
|
struct options_entry *o; |
struct options_entry *o; |
const char *s; |
|
|
|
if (oe->type != OPTIONS_TABLE_FLAG && value == NULL) { |
if (oe->type != OPTIONS_TABLE_FLAG && value == NULL) { |
cmdq_error(cmdq, "empty value"); |
cmdq_error(cmdq, "empty value"); |
|
|
} |
} |
if (o == NULL) |
if (o == NULL) |
return (-1); |
return (-1); |
|
|
s = options_table_print_entry(oe, o, 0); |
|
if (!args_has(args, 'q')) |
|
cmdq_info(cmdq, "set option: %s -> %s", oe->name, s); |
|
return (0); |
return (0); |
} |
} |
|
|