From 3879c0a77497340424d24aa2ce7d5554441414ea Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 4 Nov 2013 13:41:11 +0100 Subject: [PATCH] Add --version option to type(1) --- utils/type.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/type.cpp b/utils/type.cpp index 705274e4..dbdd790b 100644 --- a/utils/type.cpp +++ b/utils/type.cpp @@ -29,6 +29,10 @@ #include #include +#if !defined(VERSIONSTR) +#define VERSIONSTR "unknown version" +#endif + void usage(FILE* fp, const char* argv0) { fprintf(fp, "usage: %s [--usage | --help | --version]\n", argv0); @@ -42,7 +46,10 @@ void help(FILE* fp, const char* argv0) void version(FILE* fp, const char* argv0) { - return 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[])