]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Added help message to switchlevels.
authorNathan Moinvaziri <nathan@nathanm.com>
Thu, 4 Jun 2020 17:58:37 +0000 (10:58 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 8 Jun 2020 12:50:46 +0000 (14:50 +0200)
test/switchlevels.c

index c23acda57cbd515ad8397a089617b1ced2e40281..ce5bfe5fcc0ac465fab6e85cc261dce9b980b606 100644 (file)
@@ -107,10 +107,11 @@ done:
     return ret;
 }
 
-/* ===========================================================================
- * Usage:  switchlevels [-w bits] level1 size1 [level2 size2 ...]
- *   -w : window bits
- */
+void show_help(void)
+{
+    printf("Usage: switchlevels [-w bits] level1 size1 [level2 size2 ...]\n\n" \
+           "  -w : window bits (8 to 15 for gzip, -8 to -15 for zlib)\n\n");
+}
 
 int main(int argc, char **argv) {
     int ret = EXIT_FAILURE;
@@ -121,6 +122,12 @@ int main(int argc, char **argv) {
     int window_bits = MAX_WBITS + 16;
     PREFIX3(stream) strm;
 
+
+    if ((argc == 1) || (argc == 2 && strcmp(argv[1], "--help") == 0)) {
+        show_help();
+        return 0;
+    }
+
     SET_BINARY_MODE(stdin);
     SET_BINARY_MODE(stdout);