Give a better error message when no service specified.

This commit is contained in:
Roy Marples 2008-03-19 20:04:48 +00:00
parent 97abd91577
commit d948e65d60

View File

@ -364,9 +364,13 @@ static int do_shell_var(int argc, char **argv)
static int rc_service(_unused int argc, char **argv)
{
char *service = rc_service_resolve(argv[1]);
char *service;
if (!service)
if (argc < 3)
eerrorx("%s: you need to specify a service and command(s)",
applet);
if (!(service = rc_service_resolve(argv[1])))
eerrorx("%s: service `%s' does not exist", applet, argv[1]);
*++argv = service;