From 9a08acb8f3c53bc5c8a7ca8c2333743eb6c34dce Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 4 Nov 2013 13:41:01 +0100 Subject: [PATCH] Add --version option to uname(1) --- utils/uname.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/uname.cpp b/utils/uname.cpp index fc0e5c95..af8bbd4e 100644 --- a/utils/uname.cpp +++ b/utils/uname.cpp @@ -28,6 +28,10 @@ #include #include +#if !defined(VERSIONSTR) +#define VERSIONSTR "unknown version" +#endif + const unsigned long PRINT_KERNELNAME = 1UL << 0UL; const unsigned long PRINT_NODENAME = 1UL << 1UL; const unsigned long PRINT_KERNELREL = 1UL << 2UL; @@ -120,7 +124,10 @@ void Help(FILE* fp, const char* argv0) void Version(FILE* fp, const char* argv0) { - Usage(fp, argv0); + 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[])