aboutsummaryrefslogtreecommitdiffstats
path: root/src/s6/help.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-06-06 18:15:00 +0000
committerLaurent Bercot <ska@appnovation.com>2025-06-06 18:15:00 +0000
commit0db2f82a71f627be6b0feff3541862072653181e (patch)
tree8bd1c7d1e5def588ca83cd68664893403521326f /src/s6/help.c
parent3f75ffee7c0c7d6b70cf305d60435ac862ea9ab5 (diff)
downloads6-frontend-0db2f82a71f627be6b0feff3541862072653181e.tar.gz
Add skeleton for "s6 service"
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/s6/help.c')
-rw-r--r--src/s6/help.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/s6/help.c b/src/s6/help.c
index f7de80f..ac2205c 100644
--- a/src/s6/help.c
+++ b/src/s6/help.c
@@ -5,12 +5,33 @@
#include "s6-internal.h"
-#define HELP_MESSAGE "This is the main help message.\n"
+#define MAIN_HELP_MESSAGE "This is the main help message.\n"
-int help (char const *const *argv)
+#define PROCESS_HELP_MESSAGE "This is the process help message.\n"
+
+#define SERVICE_HELP_MESSAGE "This is the service help message.\n"
+
+static int print_help (char const *msg)
{
- (void)argv ;
- if (!buffer_putsflush(buffer_1, HELP_MESSAGE))
+ if (!buffer_putsflush(buffer_1, msg))
strerr_diefu1sys(111, "write to stdout") ;
return 0 ;
}
+
+int process_help (char const* const *argv)
+{
+ (void)argv ;
+ return print_help(PROCESS_HELP_MESSAGE) ;
+}
+
+int service_help (char const* const *argv)
+{
+ (void)argv ;
+ return print_help(SERVICE_HELP_MESSAGE) ;
+}
+
+int help (char const *const *argv)
+{
+ (void)argv ;
+ return print_help(MAIN_HELP_MESSAGE) ;
+}