projects
/
project
/
ubus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add some stub functionality for the ubus event switch
[project/ubus.git]
/
cli.c
diff --git
a/cli.c
b/cli.c
index
c0521fa
..
59e62ed
100644
(file)
--- a/
cli.c
+++ b/
cli.c
@@
-34,6
+34,7
@@
static int usage(char *prog)
"Commands:\n"
" - list [<path>] List objects\n"
" - call <path> <method> [<message>] Call an object method\n"
"Commands:\n"
" - list [<path>] List objects\n"
" - call <path> <method> [<message>] Call an object method\n"
+ " - listen [<path>...] Listen for events\n"
"\n", prog);
return 1;
}
"\n", prog);
return 1;
}
@@
-70,6
+71,8
@@
int main(int argc, char **argv)
ret = ubus_lookup_id(ctx, argv[2], &id);
if (!ret)
ret = ubus_invoke(ctx, id, argv[3], NULL, receive_data, NULL);
ret = ubus_lookup_id(ctx, argv[2], &id);
if (!ret)
ret = ubus_invoke(ctx, id, argv[3], NULL, receive_data, NULL);
+ } else if (!strcmp(cmd, "listen")) {
+ ret = ubus_invoke(ctx, UBUS_SYSTEM_OBJECT_EVENT, "listen", NULL, receive_data, NULL);
} else {
return usage(argv[0]);
}
} else {
return usage(argv[0]);
}