aboutsummaryrefslogtreecommitdiff
path: root/src/rc/_usage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/_usage.c')
-rw-r--r--src/rc/_usage.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/rc/_usage.c b/src/rc/_usage.c
index ec1ce1d3..175634af 100644
--- a/src/rc/_usage.c
+++ b/src/rc/_usage.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
* All rights reserved
-
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -24,6 +24,8 @@
* SUCH DAMAGE.
*/
+#include "version.h"
+
#if lint
# define _noreturn
#endif
@@ -34,6 +36,22 @@
#endif
_noreturn static void
+show_version(void)
+{
+ const char *bootlevel = NULL;
+
+ printf("%s (OpenRC", applet);
+ if ((bootlevel = rc_sys()))
+ printf(" [%s]", bootlevel);
+ printf(") %s", VERSION);
+#ifdef BRANDING
+ printf(" (%s)", BRANDING);
+#endif
+ printf("\n");
+ exit(EXIT_SUCCESS);
+}
+
+_noreturn static void
usage(int exit_status)
{
const char * const has_arg[] = { "", "<arg>", "[arg]" };