From 238de22ce8619f8d6d17ae8fed78cf647cef2ed2 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 4 Nov 2013 13:42:13 +0100 Subject: [PATCH] Add --version option to kernelinfo(1) --- utils/kernelinfo.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils/kernelinfo.cpp b/utils/kernelinfo.cpp index bff1f98a..99cd79f8 100644 --- a/utils/kernelinfo.cpp +++ b/utils/kernelinfo.cpp @@ -27,6 +27,10 @@ #include #include +#if !defined(VERSIONSTR) +#define VERSIONSTR "unknown version" +#endif + void usage(const char* argv0) { printf("usage: %s ...\n", argv0); @@ -44,7 +48,11 @@ void help(const char* argv0) void version(const char* argv0) { - usage(argv0); + FILE* fp = stdout; + fprintf(fp, "%s (Sortix) %s\n", argv0, VERSIONSTR); + fprintf(fp, "License GPLv3+: GNU GPL version 3 or later .\n"); + fprintf(fp, "This is free software: you are free to change and redistribute it.\n"); + fprintf(fp, "There is NO WARRANTY, to the extent permitted by law.\n"); } int main(int argc, char* argv[])