aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/main.c b/main.c
index ab595d22..59ac9b61 100644
--- a/main.c
+++ b/main.c
@@ -21,6 +21,7 @@
#include "log.h"
#include "config.h"
+#include "foot-features.h"
#include "fdm.h"
#include "reaper.h"
#include "render.h"
@@ -39,6 +40,15 @@ sig_handler(int signo)
aborted = 1;
}
+static const char *
+version_and_features(void)
+{
+ static char buf[256];
+ snprintf(buf, sizeof(buf), "version: %s %cime",
+ FOOT_VERSION, feature_ime() ? '+' : '-');
+ return buf;
+}
+
static void
print_usage(const char *prog_name)
{
@@ -325,7 +335,7 @@ main(int argc, char *const *argv)
break;
case 'v':
- printf("foot version %s\n", FOOT_VERSION);
+ printf("foot %s\n", version_and_features());
return EXIT_SUCCESS;
case 'h':
@@ -343,7 +353,7 @@ main(int argc, char *const *argv)
argc -= optind;
argv += optind;
- LOG_INFO("version: %s", FOOT_VERSION);
+ LOG_INFO("%s", version_and_features());
{
struct utsname name;