aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-19 20:04:48 +0000
committerRoy Marples <roy@marples.name>2008-03-19 20:04:48 +0000
commitd948e65d60911fe499b9ffa43bce531ae396118f (patch)
tree1b4b4d5c30e9b4f6b3a97c4a4721a04d8df4fada /src/rc
parent97abd915772777b7bfe56c7d8574394eb9bc7058 (diff)
Give a better error message when no service specified.
Diffstat (limited to 'src/rc')
-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 513e2d93..8a54a5ac 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;