Skip to content

Commit

Permalink
Fix version information as suggested by #31
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmilk committed Jul 12, 2024
1 parent 1818d61 commit a80965e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
5 changes: 2 additions & 3 deletions programs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BRO_VER = "v1.1.0"
LIZ_VER = "v1.0"
LZ4_VER = "v1.9.4"
LZ5_VER = "v1.5"
ZSTD_VER= "v1.5.5"
ZSTD_VER= "v1.5.6"
SNAP_VER= "v0.0.0"
LZFSE_VER="lzfse-1.0"

Expand All @@ -29,9 +29,8 @@ LN = ln -sf
#CC = $(CROSS)clang
CC = $(CROSS)gcc
RANLIB = $(CROSS)ranlib
#STRIP = $(CROSS)strip
STRIP = $(CROSS)strip
SFLAGS = -R .note -R .comment
#SFLAGS = -R .note .comment

CFLAGS = -W -pthread -Wall -pipe
CFLAGS += -fomit-frame-pointer
Expand Down
23 changes: 12 additions & 11 deletions programs/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/**
* Copyright (c) 2017 - 2020 Tino Reichardt
* Copyright (c) 2017 - 2024 Tino Reichardt
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
Expand Down Expand Up @@ -79,19 +79,20 @@ static void panic(const char *msg)
exit(1);
}

static void version(void)
static void version(int quit)
{
printf("%s version %s, zstdmt v0.8\n"
"\nCopyright (c) 2016 - 2020 Tino Reichardt" "\n"
"\n", progname, VERSION);
exit(0);
printf(" %s using libzstdmt v0.8, using %s %s"
"\n Copyright (c) 2016 - 2024 Tino Reichardt",
progname, METHOD, VERSION);

if (quit)
exit(0);
}

static void license(void)
{
printf("\n %s version %s\n"
"\n Copyright (c) 2016 - 2020 Tino Reichardt"
"\n "
version(0);
printf("\n"
"\n Redistribution and use in source and binary forms, with or without modification,"
"\n are permitted provided that the following conditions are met:"
"\n "
Expand All @@ -114,7 +115,7 @@ static void license(void)
"\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
"\n "
"\n Report bugs to: https://github.com/mcmilk/zstdmt/issues"
"\n", progname, VERSION);
"\n");
exit(0);
}

Expand Down Expand Up @@ -832,7 +833,7 @@ int main(int argc, char **argv)
break;

case 'V': /* version */
version();
version(1);
break;

/* 2) additional options */
Expand Down

0 comments on commit a80965e

Please sign in to comment.