git: 6e6da538988a - main - wc: Add version information to libxo output
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 06 Sep 2024 18:35:16 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=6e6da538988a5edb5cc7437f8a8647a350800724
commit 6e6da538988a5edb5cc7437f8a8647a350800724
Author: Bram <bram@cbbg.nl>
AuthorDate: 2024-07-26 19:36:18 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-09-06 18:34:31 +0000
wc: Add version information to libxo output
Add version information to libxo output so that
libxo content consumers can track changes.
Reviewed by: imp, markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/1350
---
usr.bin/wc/wc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c
index 4e8a2d8a8b59..7b83412f3c42 100644
--- a/usr.bin/wc/wc.c
+++ b/usr.bin/wc/wc.c
@@ -51,6 +51,8 @@
#include <libcasper.h>
#include <casper/cap_fileargs.h>
+#define WC_XO_VERSION "1"
+
static const char *stdin_filename = "stdin";
static fileargs_t *fa;
@@ -132,6 +134,8 @@ main(int argc, char *argv[])
doline = doword = dochar = true;
stderr_handle = xo_create_to_file(stderr, XO_STYLE_TEXT, 0);
+
+ xo_set_version(WC_XO_VERSION);
xo_open_container("wc");
xo_open_list("file");