From 12633b68c6ee34e09b6090fc9e7922ea916ed506 Mon Sep 17 00:00:00 2001 From: Jeff Lenamon <85593689+lenamonj@users.noreply.github.com> Date: Mon, 7 Sep 2026 00:03:16 -0400 Subject: [PATCH] brotli CLI: accept -bare and -bytealign with -catable, exit 1 when rejected The -bare and -bytealign guards tested appendable alone, but -catable only implies appendable once SanitizeParams runs, so the README's `-bare -catable` recipe was rejected; the rejection returned from main and exited 0 with no output. Accept -catable as the prerequisite it is and exit 1 when the guard fires. --- src/bin/brotli.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bin/brotli.rs b/src/bin/brotli.rs index aeb2b754..b73306eb 100644 --- a/src/bin/brotli.rs +++ b/src/bin/brotli.rs @@ -852,13 +852,15 @@ fn main() { } panic!("Unknown Argument {:}", argument); } - if params.bare_stream && !params.appendable { + // -catable implies -appendable, but SanitizeParams only derives that later + let concatenable = params.appendable || params.catable; + if params.bare_stream && !concatenable { println_stderr!("bare streams only supported when catable or appendable!"); - return; + std::process::exit(1); } - if params.byte_align && !params.appendable { + if params.byte_align && !concatenable { println_stderr!("byte aligned streams only supported when catable or appendable!"); - return; + std::process::exit(1); } if filenames[0] != "" { let mut input = match File::open(Path::new(&filenames[0])) {