aboutsummaryrefslogtreecommitdiffstats
path: root/version.c
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-07-23 02:59:41 +0800
committerverdant <im@verdant.ee>2026-07-23 02:59:41 +0800
commit6ef3bfdf2f7e19cd74220a2c8c56250a7f13f0ce (patch)
treec15aa5b24b585bd7aa894a8053e254c949b27677 /version.c
parentb60c5884744686f4cbc8bb9eb76137c09537aea2 (diff)
downloadsf-6ef3bfdf2f7e19cd74220a2c8c56250a7f13f0ce.tar.gz
sf-6ef3bfdf2f7e19cd74220a2c8c56250a7f13f0ce.zip
Add version function
This function outputs program name, build date, author(s) and license
Diffstat (limited to 'version.c')
-rw-r--r--version.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/version.c b/version.c
new file mode 100644
index 0000000..234a9f5
--- /dev/null
+++ b/version.c
@@ -0,0 +1,16 @@
+#include "./version.h"
+#include <stdio.h>
+#include <stdlib.h>
+void version()
+{
+ printf(PROGRAM_NAME
+ " " PROGRAM_VERSION " (built " BUILD_DATE
+ " with gcc " GCC_VERSION ")\n"
+ "Copyright (C) 2026 " PROGRAM_AUTHOR ".\n"
+ "License GPLv3+: GNU GPL version 3 or later "
+ "<https://gnu.org/licenses/gpl.html>.\n"
+ "This is free software: you are free to change and redistribute "
+ "it.\n"
+ "There is NO WARRANTY, to the extent permitted by law.\n");
+ exit(EXIT_SUCCESS);
+}