From 72f9f7e828679086a4c242d947cc3040ecdf910e Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 7 Jan 2010 10:00:57 +0000 Subject: services_in_runlevel: the runlevel arg is optional calling it without arg will ist all runlevels --- rc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc.c b/rc.c index 955887c..cee3e37 100644 --- a/rc.c +++ b/rc.c @@ -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) { -- cgit v1.2.3