2
0
mirror of https://github.com/vasi/pixz synced 2024-10-30 15:21:41 +00:00

Add -V flag to print application version

Signed-off-by: Igor Shishkin <me@teran.ru>
This commit is contained in:
Igor Shishkin 2022-01-22 01:24:07 +03:00
parent 0829c7315c
commit 631c916068
No known key found for this signature in database
GPG Key ID: 6B7414201DCED2E4

View File

@ -44,6 +44,7 @@ static void usage(const char *msg) {
" -t Don't assume input is in tar format\n"
" -k Keep original input (do not remove it)\n"
" -c ignored\n"
" -V Print version and exit\n"
" -h Print this help\n"
"\n"
"pixz %s\n"
@ -56,6 +57,11 @@ static void usage(const char *msg) {
exit(0);
}
static void version() {
fprintf(stderr, "pixz %s\n", PACKAGE_VERSION);
exit(0);
}
int main(int argc, char **argv) {
uint32_t level = LZMA_PRESET_DEFAULT;
bool tar = true;
@ -80,6 +86,7 @@ int main(int argc, char **argv) {
case 'k': keep_input = true; break;
case 'h': usage(NULL); break;
case 'e': extreme = true; break;
case 'V': version(); break;
case 'f':
optdbl = strtod(optarg, &optend);
if (*optend || optdbl <= 0)