summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-10-15 08:54:19 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-10-15 08:54:19 +0000
commit013d6303712521323cec741d05bebc44c59ae9c3 (patch)
treee7811a77e84e71bd9323b3db7315386c3a5da1dd
parent8f79518ff8fe04fd02857a4fcbdc3912ee1dea72 (diff)
downloadlua-augeas-013d6303712521323cec741d05bebc44c59ae9c3.tar.bz2
lua-augeas-013d6303712521323cec741d05bebc44c59ae9c3.tar.xz
implement rm()
-rw-r--r--laugeas.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/laugeas.c b/laugeas.c
index abd1c90..f7bef35 100644
--- a/laugeas.c
+++ b/laugeas.c
@@ -143,6 +143,13 @@ static int Paug_set(lua_State *L)
return pushresult(L, aug_set(a, path, value), a, path);
}
+static int Paug_rm(lua_State *L)
+{
+ augeas *a = Paug_checkarg(L, 1);
+ const char *path = luaL_checkstring(L, 2);
+ return pushresult(L, aug_rm(a, path), a, NULL);
+}
+
static int Paug_save(lua_State *L)
{
augeas *a = Paug_checkarg(L, 1);
@@ -172,6 +179,7 @@ static const luaL_reg Paug_methods[] = {
{"close", Paug_close},
{"get", Paug_get},
{"set", Paug_set},
+ {"rm", Paug_rm},
{"save", Paug_save},
{"load", Paug_load},
{"print", Paug_print},