summaryrefslogtreecommitdiff
path: root/src/rc/rc-applets.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/rc-applets.c')
-rw-r--r--src/rc/rc-applets.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rc/rc-applets.c b/src/rc/rc-applets.c
index 513e2d9..8a54a5a 100644
--- a/src/rc/rc-applets.c
+++ b/src/rc/rc-applets.c
@@ -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]);
-
- if (!service)
+ char *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;