summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-01-07 08:02:05 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-01-07 08:02:05 +0000
commitcefe7e4ce2ea3dceb1cf667e8397ef285a80d0c9 (patch)
tree9b34deaa1049081bfc5ee0fea33192d0aaba278e
parentdc41f45a9d4512970e7ef62669b64ee0e20add10 (diff)
downloadlua-openrc-cefe7e4ce2ea3dceb1cf667e8397ef285a80d0c9.tar.bz2
lua-openrc-cefe7e4ce2ea3dceb1cf667e8397ef285a80d0c9.tar.xz
implement service_description()
-rw-r--r--rc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/rc.c b/rc.c
index d53e35e..3660d5f 100644
--- a/rc.c
+++ b/rc.c
@@ -59,6 +59,15 @@ static int Pservice_delete(lua_State *L)
return 1;
}
+/** service_description(service, [option]) - Returns a description of what the service and/or option does. */
+static int Pservice_description(lua_State *L)
+{
+ const char *service = luaL_checkstring(L, 1);
+ const char *option = luaL_optstring(L, 2, NULL);
+ lua_pushstring(L, rc_service_description(service, option));
+ return 1;
+}
+
/** service_exists(service) - Checks if a service exists or not.*/
static int Pservice_exists(lua_State *L)
{
@@ -94,6 +103,7 @@ static const luaL_reg R[] =
{"service_add", Pservice_add},
{"service_delete", Pservice_delete},
+ {"service_description", Pservice_description},
{"service_exists", Pservice_exists},
{"service_in_runlevel", Pservice_in_runlevel},
{"service_resolve", Pservice_resolve},