diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-01-07 08:02:05 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-01-07 08:02:05 +0000 |
commit | cefe7e4ce2ea3dceb1cf667e8397ef285a80d0c9 (patch) | |
tree | 9b34deaa1049081bfc5ee0fea33192d0aaba278e /rc.c | |
parent | dc41f45a9d4512970e7ef62669b64ee0e20add10 (diff) | |
download | lua-openrc-cefe7e4ce2ea3dceb1cf667e8397ef285a80d0c9.tar.bz2 lua-openrc-cefe7e4ce2ea3dceb1cf667e8397ef285a80d0c9.tar.xz |
implement service_description()
Diffstat (limited to 'rc.c')
-rw-r--r-- | rc.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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}, |