This commit is contained in:
2025-11-05 09:25:02 -05:00
parent d32d48ab36
commit adedeb5b63
9 changed files with 397 additions and 706 deletions

View File

@@ -53,16 +53,16 @@ void emit_try_help()
printf("Try '%s --help' for more information\n", prog_name);
}
void emit_version()
{
printf("\
%s %s %d\n\
Copyright (C) %d GCK.\n\
This is free software: you are free to change and redistribute it.\n\
There is NO WARRNTY, to the extent permitted by law.\n\
",
prog_name, VERSION, COMMIT, YEAR);
}
// void emit_version()
// {
// printf("\
// %s %s %d\n\
// Copyright (C) %d GCK.\n\
// This is free software: you are free to change and redistribute it.\n\
// There is NO WARRNTY, to the extent permitted by law.\n\
// ",
// prog_name, VERSION, COMMIT, YEAR);
// }
int parse_standard_options(int argc, char **argv, void (*print_help)(),
void (*print_version)())
@@ -72,7 +72,7 @@ int parse_standard_options(int argc, char **argv, void (*print_help)(),
print_help();
exit(EXIT_SUCCESS);
} else if (!strcmp(argv[i], "--version")) {
emit_version();
print_version();
exit(EXIT_SUCCESS);
}
}