From 9f8a0daa7aebd3d3673e26949b44864e4b3a450d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 12 May 2026 21:02:59 +0000 Subject: Add verbosity; update s6 version doc --- doc/s6.html | 9 ++--- doc/s6_version.html | 86 ++++++++++++++++++++++++++++++++++++++++ src/s6-frontend/version_export.c | 8 +++- 3 files changed, 96 insertions(+), 7 deletions(-) create mode 100644 doc/s6_version.html diff --git a/doc/s6.html b/doc/s6.html index 00976ff..a1f348f 100644 --- a/doc/s6.html +++ b/doc/s6.html @@ -89,10 +89,6 @@ reason, here you go.
Run the s6 help command. Any given command or subcommand is ignored.
-
-V, --version
-
Run the s6 version command. -Any given command or subcommand is ignored.
-
-s scandir, --scandir=scandir
Use scandir as scan directory (i.e. the directory where s6-svscan runs @@ -151,11 +147,12 @@ and usage of the s6 command. It is not as detailed as this page.

version

- s6 version prints the current version of s6-frontend, on one line. + s6 version prints information about the current version of +s6-frontend and its configuration.

- No subcommands are defined. + The details are available here.

process

diff --git a/doc/s6_version.html b/doc/s6_version.html new file mode 100644 index 0000000..85b3d20 --- /dev/null +++ b/doc/s6_version.html @@ -0,0 +1,86 @@ + + + + + + + s6-frontend: the s6 version command + + + + + + +

+The s6 command
+s6-frontend
+Software
+skarnet.org +

+ +

The s6 version command

+ +

+ s6 version groups actions related to printing information about the +current version and configuration of s6-frontend. +

+ +

Interface

+ +
+     s6 version subcommand [ subcommand_options... ] [ args... ]
+
+ + + +

Subcommands

+ +

help

+ +

+ s6 process help prints a short help message summarizing the options +and usage of the s6 process command. It is not as detailed as this page. +

+ +

show

+ +

Interface

+ +
+     s6 version show
+
+ + + +

export

+ +

Interface

+ +
+     s6 version export [ -q ]
+
+ + + +

Options

+ +
+
-q, --quote
+
Quote the printed paths. This is useful e.g. if the paths contain spaces +and you're reading the output of s6 version export in a shell.
+
+ + + diff --git a/src/s6-frontend/version_export.c b/src/s6-frontend/version_export.c index 14e0de3..b62b8ac 100644 --- a/src/s6-frontend/version_export.c +++ b/src/s6-frontend/version_export.c @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -50,6 +51,9 @@ void version_export (char const *const *argv) stralloc sa = STRALLOC_ZERO ; uint64_t wgolb = 0 ; out_func_ref f = &print_unquoted ; + size_t len ; + char fmt[UINT_FMT] ; + argv += gol_argv(argv, rgolb, 1, 0, 0, &wgolb, 0) ; if (wgolb & GOLB_QUOTE) f = &print_quoted ; @@ -60,6 +64,8 @@ void version_export (char const *const *argv) (*f)("bootdb", g->dirs.scan, &sa) ; (*f)("stmpdir", g->dirs.stmp, &sa) ; (*f)("storelist", g->dirs.stol, &sa) ; - if (!buffer_flush(buffer_1)) dieout() ; + len = uint_fmt(fmt, g->verbosity) ; fmt[len++] = '\n' ; + if (!buffer_puts(buffer_1, "verbosity=") + || !buffer_putflush(buffer_1, fmt, len)) dieout() ; _exit(0) ; } -- cgit v1.3.1