Print version

This commit is contained in:
Matteo Bini 2024-07-15 10:43:40 +02:00
parent f005138672
commit 2f25133615
1 changed files with 11 additions and 0 deletions

View File

@ -598,6 +598,17 @@ main (int argc, char *argv[])
size_t len; size_t len;
char *line; char *line;
if (argc == 2 && (!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version"))) {
fprintf(stdout, BIN " " VERSION "\n");
fprintf(stdout, "Copyright (C) 2024 Matteo Bini\n");
fprintf(stdout, "License: GPLv3+ <http://www.gnu.org/licenses/gpl.html>.\n");
fprintf(stdout, "This is free software: you are free to change and redistribute it.\n");
fprintf(stdout, "There is NO WARRANTY, to the extent permitted by law.\n");
fprintf(stdout, "\n");
fprintf(stdout, "Written by Matteo Bini.\n");
return 1;
}
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
in = fopen(argv[1], "r"); in = fopen(argv[1], "r");