From 62707d27b0519b195b0d39ff6329f7205c57c509 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Sat, 5 Jul 2025 19:20:25 +0200 Subject: [PATCH] add version to help --- meson.build | 4 +++- src/main.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a343af5..76a6944 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,8 @@ project('diya-session-manager', version: '0.1.1', license: 'MIT', meson_version: '>=0.58.0', - default_options: ['c_std=gnu11', 'warning_level=3']) + default_options: ['c_std=gnu11', 'warning_level=3'] +) lib_so_version = '0' @@ -17,6 +18,7 @@ add_project_arguments( '-Wno-pedantic', '-Werror=implicit-function-declaration', '-Werror=return-type', + '-DVERSION="@0@"'.format(meson.project_version()) ], language: 'c') diff --git a/src/main.c b/src/main.c index a0aeadc..8152129 100644 --- a/src/main.c +++ b/src/main.c @@ -16,7 +16,11 @@ static gchar **g_shell_argv; static void help(const char* name) { + printf("diya-session-manager - a session manager for diya shells\n"); printf("Usage: %s [-c config_file]\n" ,name); +#ifdef VERSION + printf("Version: %s\n", VERSION); +#endif } static gboolean restart(gpointer d)