]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
add quiet option, make progress bar default
authorPaul Cruz <paulcruz74@fb.com>
Mon, 24 Jul 2017 23:19:07 +0000 (16:19 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Mon, 24 Jul 2017 23:19:07 +0000 (16:19 -0700)
contrib/adaptive-compression/adapt.c

index ef0da42f82ae65c42afada29348475fecaf81f91..c4c46af5da9a40b5ff8beb125253a0aedf6fd2da 100644 (file)
@@ -31,7 +31,7 @@ static int g_displayLevel = DEFAULT_DISPLAY_LEVEL;
 static unsigned g_compressionLevel = DEFAULT_COMPRESSION_LEVEL;
 static UTIL_time_t g_startTime;
 static size_t g_streamedSize = 0;
-static unsigned g_useProgressBar = 0;
+static unsigned g_useProgressBar = 1;
 static UTIL_freq_t g_ticksPerSecond;
 static unsigned g_forceCompressionLevel = 0;
 
@@ -903,6 +903,7 @@ static void help()
     PRINT("  -i#    : provide initial compression level\n");
     PRINT("  -h     : display help/information\n");
     PRINT("  -f     : force the compression level to stay constant\n");
+    PRINT("  -q     : quiet mode -- do not show progress bar or other information\n");
 }
 /* return 0 if successful, else return error */
 int main(int argCount, const char* argv[])
@@ -953,6 +954,10 @@ int main(int argCount, const char* argv[])
                 case 'f':
                     g_forceCompressionLevel = 1;
                     break;
+                case 'q':
+                    g_useProgressBar = 0;
+                    g_displayLevel = 0;
+                    break;
                 default:
                     DISPLAY("Error: invalid argument provided\n");
                     ret = 1;