From 043426b3e226a6f4b7325cfbdd21da90f702a892 Mon Sep 17 00:00:00 2001 From: Jennifer Lee Date: Mon, 9 Mar 2026 16:30:41 -0700 Subject: [PATCH 1/4] Promote flag --- programs/zstdcli.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 34db7bf51..19c6cae89 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -147,6 +147,7 @@ static void usage(FILE* f, const char* programName) DISPLAY_F(f, "Usage: %s [OPTIONS...] [INPUT... | -] [-o OUTPUT]\n\n", programName); DISPLAY_F(f, "Options:\n"); DISPLAY_F(f, " -o OUTPUT Write output to a single file, OUTPUT.\n"); + DISPLAY_F(f, " -c, --stdout Write to STDOUT (even if it is a console) and keep the INPUT file(s).\n"); DISPLAY_F(f, " -k, --keep Preserve INPUT file(s). [Default] \n"); DISPLAY_F(f, " --rm Remove INPUT file(s) after successful (de)compression to file.\n"); #ifdef ZSTD_GZCOMPRESS @@ -167,7 +168,8 @@ static void usage(FILE* f, const char* programName) DISPLAY_F(f, " -f, --force Disable input and output checks. Allows overwriting existing files,\n"); DISPLAY_F(f, " receiving input from the console, printing output to STDOUT, and\n"); DISPLAY_F(f, " operating on links, block devices, etc. Unrecognized formats will be\n"); - DISPLAY_F(f, " passed-through through as-is.\n\n"); + DISPLAY_F(f, " passed-through through as-is.\n"); + DISPLAY_F(f, " -q, --quiet Suppress warnings; pass twice to suppress errors.\n\n"); DISPLAY_F(f, " -h Display short usage and exit.\n"); DISPLAY_F(f, " -H, --help Display full help and exit.\n"); @@ -181,10 +183,8 @@ static void usageAdvanced(const char* programName) DISPLAYOUT("\n"); usage(stdout, programName); DISPLAYOUT("Advanced options:\n"); - DISPLAYOUT(" -c, --stdout Write to STDOUT (even if it is a console) and keep the INPUT file(s).\n\n"); DISPLAYOUT(" -v, --verbose Enable verbose output; pass multiple times to increase verbosity.\n"); - DISPLAYOUT(" -q, --quiet Suppress warnings; pass twice to suppress errors.\n"); #ifndef ZSTD_NOTRACE DISPLAYOUT(" --trace LOG Log tracing information to LOG.\n"); #endif From 13ea076d3b8df315cb6731971f594b8bb4f4e401 Mon Sep 17 00:00:00 2001 From: Jennifer Lee Date: Mon, 9 Mar 2026 16:40:42 -0700 Subject: [PATCH 2/4] Update tests --- tests/cli-tests/basic/help.sh.stdout.glob | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/cli-tests/basic/help.sh.stdout.glob b/tests/cli-tests/basic/help.sh.stdout.glob index 66c6906cf..eb249bf2b 100644 --- a/tests/cli-tests/basic/help.sh.stdout.glob +++ b/tests/cli-tests/basic/help.sh.stdout.glob @@ -5,6 +5,7 @@ Usage: zstd *OPTIONS...* *INPUT... | -* *-o OUTPUT* Options: -o OUTPUT Write output to a single file, OUTPUT. + -c, --stdout Write to STDOUT (even if it is a console) and keep the INPUT file(s). -k, --keep Preserve INPUT file(s). *Default* --rm Remove INPUT file(s) after successful (de)compression to file. @@ -19,11 +20,12 @@ Options: receiving input from the console, printing output to STDOUT, and operating on links, block devices, etc. Unrecognized formats will be passed-through through as-is. + -q, --quiet Suppress warnings; pass twice to suppress errors. -h Display short usage and exit. -H, --help Display full help and exit. -V, --version Display the program version and exit. - + + zstd -H ... Advanced options: From 3f565b731e65b48800e2a8da31825b5b2af15c26 Mon Sep 17 00:00:00 2001 From: Jennifer Lee Date: Thu, 12 Mar 2026 11:32:48 -0700 Subject: [PATCH 3/4] rever -q --- programs/zstdcli.c | 4 ++-- tests/cli-tests/basic/help.sh.stdout.glob | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 19c6cae89..b3c7a9900 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -168,8 +168,7 @@ static void usage(FILE* f, const char* programName) DISPLAY_F(f, " -f, --force Disable input and output checks. Allows overwriting existing files,\n"); DISPLAY_F(f, " receiving input from the console, printing output to STDOUT, and\n"); DISPLAY_F(f, " operating on links, block devices, etc. Unrecognized formats will be\n"); - DISPLAY_F(f, " passed-through through as-is.\n"); - DISPLAY_F(f, " -q, --quiet Suppress warnings; pass twice to suppress errors.\n\n"); + DISPLAY_F(f, " passed-through through as-is.\n\n"); DISPLAY_F(f, " -h Display short usage and exit.\n"); DISPLAY_F(f, " -H, --help Display full help and exit.\n"); @@ -185,6 +184,7 @@ static void usageAdvanced(const char* programName) DISPLAYOUT("Advanced options:\n"); DISPLAYOUT(" -v, --verbose Enable verbose output; pass multiple times to increase verbosity.\n"); + DISPLAY_F(f, " -q, --quiet Suppress warnings; pass twice to suppress errors.\n"); #ifndef ZSTD_NOTRACE DISPLAYOUT(" --trace LOG Log tracing information to LOG.\n"); #endif diff --git a/tests/cli-tests/basic/help.sh.stdout.glob b/tests/cli-tests/basic/help.sh.stdout.glob index eb249bf2b..08cfdb1b3 100644 --- a/tests/cli-tests/basic/help.sh.stdout.glob +++ b/tests/cli-tests/basic/help.sh.stdout.glob @@ -20,12 +20,11 @@ Options: receiving input from the console, printing output to STDOUT, and operating on links, block devices, etc. Unrecognized formats will be passed-through through as-is. - -q, --quiet Suppress warnings; pass twice to suppress errors. -h Display short usage and exit. -H, --help Display full help and exit. -V, --version Display the program version and exit. - + + zstd -H ... Advanced options: From e374fc76fe48d394d9265641a3e1dbbcf5050bac Mon Sep 17 00:00:00 2001 From: Jennifer Lee Date: Thu, 12 Mar 2026 11:34:43 -0700 Subject: [PATCH 4/4] fix display format --- programs/zstdcli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/zstdcli.c b/programs/zstdcli.c index b3c7a9900..0cb4f3ba2 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -184,7 +184,7 @@ static void usageAdvanced(const char* programName) DISPLAYOUT("Advanced options:\n"); DISPLAYOUT(" -v, --verbose Enable verbose output; pass multiple times to increase verbosity.\n"); - DISPLAY_F(f, " -q, --quiet Suppress warnings; pass twice to suppress errors.\n"); + DISPLAYOUT(" -q, --quiet Suppress warnings; pass twice to suppress errors.\n"); #ifndef ZSTD_NOTRACE DISPLAYOUT(" --trace LOG Log tracing information to LOG.\n"); #endif