Merge pull request #101 from teran/add-version-flag

Add -V flag to print application version
pull/104/head
Dave Vasilevsky 2 years ago committed by GitHub
commit 1eb74e8ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save