{"record":{"id":"feb8bed1c98cfb8e","repo":"nodejs/node","slug":"must-pass-the-parameter-as-s-value-n","errorCode":null,"errorMessage":"must pass the parameter as --%s=value\\n","messagePattern":"must pass the parameter as --(.+?)=value\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/brotli/c/tools/brotli.c","lineNumber":596,"sourceCode":"          return COMMAND_INVALID;\n        }\n        command_set = BROTLI_TRUE;\n        command = COMMAND_TEST_INTEGRITY;\n      } else if (strcmp(\"verbose\", arg) == 0) {\n        if (params->verbosity > 0) {\n          fprintf(stderr, \"argument --verbose / -v already set\\n\");\n          return COMMAND_INVALID;\n        }\n        params->verbosity = 1;\n      } else if (strcmp(\"version\", arg) == 0) {\n        /* Don't parse further. */\n        return COMMAND_VERSION;\n      } else {\n        /* key=value */\n        const char* value = strchr(arg, '=');\n        size_t key_len;\n        if (!value || value[1] == 0) {\n          fprintf(stderr, \"must pass the parameter as --%s=value\\n\", arg);\n          return COMMAND_INVALID;\n        }\n        key_len = (size_t)(value - arg);\n        value++;\n        if (strncmp(\"comment\", arg, key_len) == 0) {\n          if (comment_set) {\n            fprintf(stderr, \"comment already set\\n\");\n            return COMMAND_INVALID;\n          }\n          params->comment_len = MAX_COMMENT_LEN;\n          if (!ParseBase64(value, params->comment, &params->comment_len)) {\n            fprintf(stderr, \"invalid base64-encoded comment\\n\");\n            return COMMAND_INVALID;\n          }\n          comment_set = BROTLI_TRUE;\n        } else if (strncmp(\"dictionary\", arg, key_len) == 0) {\n          if (params->dictionary_path) {\n            fprintf(stderr, \"dictionary path already set\\n\");","sourceCodeStart":578,"sourceCodeEnd":614,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/brotli/c/tools/brotli.c#L578-L614","documentation":"For long options that take values (`--comment`, `--dictionary`, `--lgwin`, `--large_window`, `--output`, `--quality`, `--suffix`), the brotli CLI requires the `--key=value` form. If the parser finds no `=` in the token, or finds `=` as the last character (empty value), it prints the offending token and returns COMMAND_INVALID. Unlike getopt-style tools, brotli does not consume the next argv as the value.","triggerScenarios":"Invoking `brotli --lgwin 22 file` (space-separated), `brotli --quality=` (empty value), or `brotli --suffix .br` instead of `--suffix=.br`.","commonSituations":"Users transferring habits from GNU tools that accept `--flag value`; scripting that constructs args via list join without inserting `=`; typos dropping the `=`.","solutions":["Rewrite the flag as `--key=value`, e.g. `--lgwin=22`, `--quality=11`, `--suffix=.br`.","For single-letter equivalents, use the space form (`-w 22`, `-q 11`, `-S .br`) which brotli does accept.","In scripts, build args with the literal `=` to avoid whitespace splits."],"exampleFix":"# before\nbrotli --lgwin 22 --quality 11 input.txt -o input.txt.br\n# after\nbrotli --lgwin=22 --quality=11 input.txt -o input.txt.br","handlingStrategy":"validation","validationCode":"# Require --key=value form for value-taking long options.\nvalue_opts='^(--comment|--dictionary|--lgwin|--large_window|--output|--quality|--suffix)='\nfor a in \"$@\"; do\n  case \"$a\" in\n    --comment|--dictionary|--lgwin|--large_window|--output|--quality|--suffix)\n      echo \"flag needs =value: $a\" >&2; exit 2 ;;\n    --comment=*|--dictionary=*|--lgwin=*|--large_window=*|--output=*|--quality=*|--suffix=*)\n      : ;; # well-formed\n    --comment*|--dictionary*|--lgwin*|--large_window*|--output*|--quality*|--suffix*)\n      echo \"long option must use = form: $a\" >&2; exit 2 ;;\n  esac\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair long value options with `=`; reserve the space-separated form for short options (`-w 22`).","When building arg lists in scripts, use the literal `key=value` join, not two list elements.","Read `brotli --help` to learn which long options take values."],"tags":["brotli","cli","argument-parsing","option-syntax","value-required"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}