diff options
| author | Etienne Champetier | 2022-05-01 21:58:09 +0000 |
|---|---|---|
| committer | Petr Štetiar | 2022-05-30 05:00:52 +0000 |
| commit | 2f793a4eb063128d80fc46ada243d2aad47fd1fe (patch) | |
| tree | d21cfb691b6295b32f95613eaf6fe5ea848e787f | |
| parent | 584f56a2331471459604ad054b3a7bcc366e0f07 (diff) | |
| download | ubus-2f793a4eb063128d80fc46ada243d2aad47fd1fe.tar.gz | |
lua: add optional path filter to objects() method
'ubus list [<path>]' passes the path to ubusd,
this commit fix the lua bindings to do the same
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
| -rw-r--r-- | lua/ubus.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -286,9 +286,10 @@ ubus_lua_objects(lua_State *L) { int rv; struct ubus_lua_connection *c = luaL_checkudata(L, 1, METANAME); + const char *path = (lua_gettop(L) >= 2) ? luaL_checkstring(L, 2) : NULL; lua_newtable(L); - rv = ubus_lookup(c->ctx, NULL, ubus_lua_objects_cb, L); + rv = ubus_lookup(c->ctx, path, ubus_lua_objects_cb, L); if (rv != UBUS_STATUS_OK) { |