1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

swconfig: use print_attr_val() in CMD_GET

Use the print_attr_val() function introduced by the previous patch
to simplify the get command.

Signed-off-by: Martin Mares <mj@ucw.cz>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19641 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd
2010-02-15 17:29:04 +00:00
parent 62634962e9
commit 8fdfe51f29

View File

@@ -301,23 +301,8 @@ int main(int argc, char **argv)
retval = -1; retval = -1;
goto out; goto out;
} }
switch(a->type) { print_attr_val(a, &val);
case SWITCH_TYPE_INT: putchar('\n');
printf("%d\n", val.value.i);
break;
case SWITCH_TYPE_STRING:
printf("%s\n", val.value.s);
break;
case SWITCH_TYPE_PORTS:
for(i = 0; i < val.len; i++) {
printf("%d%s ",
val.value.ports[i].id,
(val.value.ports[i].flags &
SWLIB_PORT_FLAG_TAGGED) ? "t" : "");
}
printf("\n");
break;
}
break; break;
case CMD_LOAD: case CMD_LOAD:
swconfig_load_uci(dev, ckey); swconfig_load_uci(dev, ckey);