return 1;
}
- if (ptr.o)
- e = &ptr.o->e;
- else if (ptr.s)
- e = &ptr.s->e;
- else
- e = &ptr.p->e;
-
+ e = ptr.last;
switch(cmd) {
case CMD_CHANGES:
uci_show_changes(ptr.p);
uci_export(ctx, stdout, ptr.p, true);
break;
case CMD_SHOW:
+ if (!(ptr.flags & UCI_LOOKUP_COMPLETE))
+ return 1;
switch(e->type) {
case UCI_TYPE_PACKAGE:
uci_show_package(ptr.p);
if (ptr.value && (cmd != CMD_SET) && (cmd != CMD_ADD_LIST) && (cmd != CMD_RENAME))
return 1;
- if (ptr.o)
- e = &ptr.o->e;
- else if (ptr.s)
- e = &ptr.s->e;
- else
- e = &ptr.p->e;
-
+ e = ptr.last;
switch(cmd) {
case CMD_GET:
switch(e->type) {
ret = uci_rename(ctx, &ptr);
break;
case CMD_REVERT:
- ret = uci_revert(ctx, &ptr.p, ptr.section, ptr.option);
+ ret = uci_revert(ctx, &ptr);
break;
case CMD_SET:
- ret = uci_set(ctx, ptr.p, ptr.section, ptr.option, ptr.value, NULL);
+ ret = uci_set(ctx, &ptr);
break;
case CMD_ADD_LIST:
ret = uci_add_list(ctx, &ptr);
cmd = CMD_RENAME;
else if (!strcasecmp(argv[0], "revert"))
cmd = CMD_REVERT;
- else if (!strcasecmp(argv[0], "del"))
+ else if (!strcasecmp(argv[0], "del") ||
+ !strcasecmp(argv[0], "delete"))
cmd = CMD_DEL;
else if (!strcasecmp(argv[0], "import"))
cmd = CMD_IMPORT;