Add -V flag to print application version

Signed-off-by: Igor Shishkin <me@teran.ru>
pull/101/head
Igor Shishkin 2 years ago
parent 0829c7315c
commit 631c916068
No known key found for this signature in database
GPG Key ID: 6B7414201DCED2E4

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