diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-01-07 10:00:57 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-01-07 10:00:57 +0000 |
commit | 72f9f7e828679086a4c242d947cc3040ecdf910e (patch) | |
tree | a8bc0baf0f797561c151d419befa3e5791ae35ac | |
parent | 8fd59356efa9f746a16e9d59fd0dd1fcdd132823 (diff) | |
download | lua-openrc-72f9f7e828679086a4c242d947cc3040ecdf910e.tar.bz2 lua-openrc-72f9f7e828679086a4c242d947cc3040ecdf910e.tar.xz |
services_in_runlevel: the runlevel arg is optional
calling it without arg will ist all runlevels
-rw-r--r-- | rc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -166,12 +166,12 @@ static int Pservice_status(lua_State *L) return n; } -/** services_in_runlevel(runlevel) - List the services in a runlevel */ +/** services_in_runlevel([runlevel]) - List the services in a runlevel or all services */ static int Pservices_in_runlevel(lua_State *L) { int i = 1; RC_STRING *item; - const char *runlevel = luaL_checkstring(L, 1); + const char *runlevel = luaL_optstring(L, 1, NULL); RC_STRINGLIST *list = rc_services_in_runlevel(runlevel); lua_newtable(L); TAILQ_FOREACH(item, list, entries) { |