summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-02-15 17:29:04 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-02-15 17:29:04 +0000
commit8fdfe51f296c8854915b2fbd08f06de62bffe5b6 (patch)
treee75b97442f1b0cd1120aa06e4154cdffbef87419 /package
parent62634962e96a75b9b25e5f676316151efb843bba (diff)
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
Diffstat (limited to 'package')
-rw-r--r--package/swconfig/src/cli.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/package/swconfig/src/cli.c b/package/swconfig/src/cli.c
index d8d8e512b..d99eda91d 100644
--- a/package/swconfig/src/cli.c
+++ b/package/swconfig/src/cli.c
@@ -301,23 +301,8 @@ int main(int argc, char **argv)
retval = -1;
goto out;
}
- switch(a->type) {
- case SWITCH_TYPE_INT:
- 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;
- }
+ print_attr_val(a, &val);
+ putchar('\n');
break;
case CMD_LOAD:
swconfig_load_uci(dev, ckey);