aboutsummaryrefslogtreecommitdiffstats
path: root/src/s6/s6.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/s6/s6.c')
-rw-r--r--src/s6/s6.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/s6/s6.c b/src/s6/s6.c
index c7d950c..c811b1a 100644
--- a/src/s6/s6.c
+++ b/src/s6/s6.c
@@ -1,10 +1,12 @@
/* ISC license. */
+#include <string.h>
#include <unistd.h>
#include <skalibs/uint64.h>
#include <skalibs/types.h>
#include <skalibs/buffer.h>
+#include <skalibs/prog.h>
#include <skalibs/strerr.h>
#include <skalibs/gol.h>
@@ -17,6 +19,15 @@
#define USAGE "s6 [ generic options ] command [ command options ] command_arguments... Type \"s6 help\" for details."
#define dieusage() strerr_dieusage(100, USAGE)
+
+int version (char const *const *argv)
+{
+ (void)argv ;
+ if (!buffer_putsflush(buffer_1, "s6-frontend v" S6_FRONTEND_VERSION "\n"))
+ strerr_diefu1sys(111, "write to stdout") ;
+ return 0 ;
+}
+
enum main_golb_e
{
MAIN_GOLB_HELP,