version 1.107, 2017/01/16 14:49:14 |
version 1.108, 2017/01/24 19:11:46 |
|
|
cmdq_error(item, "not an array: %s", args->argv[0]); |
cmdq_error(item, "not an array: %s", args->argv[0]); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
} else { |
} else if (*name != '@' && options_array_size(parent, NULL) != -1) { |
if (*name != '@' && options_array_size(parent, NULL) != -1) { |
if (value == NULL) { |
cmdq_error(item, "is an array: %s", args->argv[0]); |
cmdq_error(item, "empty value"); |
return (CMD_RETURN_ERROR); |
return (-1); |
} |
} |
|
if (o == NULL) |
|
o = options_empty(oo, options_table_entry(parent)); |
|
if (!args_has(args, 'a')) |
|
options_array_clear(o); |
|
options_array_assign(o, value); |
|
return (CMD_RETURN_NORMAL); |
} |
} |
|
|
/* With -o, check this option is not already set. */ |
/* With -o, check this option is not already set. */ |
|
|
else |
else |
options_remove(o); |
options_remove(o); |
} else |
} else |
options_array_set(o, idx, NULL); |
options_array_set(o, idx, NULL, 0); |
} else if (*name == '@') |
} else if (*name == '@') |
options_set_string(oo, name, args_has(args, 'a'), "%s", value); |
options_set_string(oo, name, args_has(args, 'a'), "%s", value); |
else if (idx == -1) { |
else if (idx == -1) { |
|
|
} else { |
} else { |
if (o == NULL) |
if (o == NULL) |
o = options_empty(oo, options_table_entry(parent)); |
o = options_empty(oo, options_table_entry(parent)); |
if (options_array_set(o, idx, value) != 0) { |
if (options_array_set(o, idx, value, 1) != 0) { |
cmdq_error(item, "invalid index: %s", args->argv[0]); |
cmdq_error(item, "invalid index: %s", args->argv[0]); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |