nodejs/node · error
argument --squash / -s already set\n
Error message
argument --squash / -s already set\n
What it means
`-s`/`--squash` makes brotli error on uncompressible input instead of storing it. It may be set only once; a second occurrence is rejected.
Source
Thrown at deps/brotli/c/tools/brotli.c:390
return COMMAND_HELP;
} else if (c == 'j' || c == 'k') {
if (keep_set) {
fprintf(stderr, "argument --rm / -j or --keep / -k already set\n");
return COMMAND_INVALID;
}
keep_set = BROTLI_TRUE;
params->junk_source = TO_BROTLI_BOOL(c == 'j');
continue;
} else if (c == 'n') {
if (!params->copy_stat) {
fprintf(stderr, "argument --no-copy-stat / -n already set\n");
return COMMAND_INVALID;
}
params->copy_stat = BROTLI_FALSE;
continue;
} else if (c == 's') {
if (squash_set) {
fprintf(stderr, "argument --squash / -s already set\n");
return COMMAND_INVALID;
}
squash_set = BROTLI_TRUE;
params->reject_uncompressible = BROTLI_TRUE;
continue;
} else if (c == 't') {
if (command_set) {
fprintf(stderr, "command already set when parsing -t\n");
return COMMAND_INVALID;
}
command_set = BROTLI_TRUE;
command = COMMAND_TEST_INTEGRITY;
continue;
} else if (c == 'v') {
if (params->verbosity > 0) {
fprintf(stderr, "argument --verbose / -v already set\n");
return COMMAND_INVALID;
}View on GitHub (pinned to 1b2de5e052)
Solutions
- Remove the duplicate `-s`.
- Build argv from a de-duplicated structure.
Example fix
// before brotli -s -s file // after brotli -s file
Defensive patterns
Strategy: validation
Validate before calling
assert sum(1 for a in argv if a in ('-s','--squash') or (a.startswith('-') and not a.startswith('--') and 's' in a)) <= 1 Prevention
- State each toggle once.
- Audit aliases for repeated flags.
When it happens
Trigger: Passing `-s` twice: `brotli -s -s file` or coalesced `brotli -ss file`.
Common situations: Alias + explicit duplicate; stacked short flags.
Related errors
- too many options passed
- quality already set
- write to standard output already set
- command already set when parsing -d
- force output overwrite already set\n
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/039962a6e69e657d.
Report an issue: GitHub.