{"record":{"id":"b153432702da4562","repo":"nodejs/node","slug":"command-already-set-when-parsing-t-n","errorCode":null,"errorMessage":"command already set when parsing -t\\n","messagePattern":"command already set when parsing -t\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/brotli/c/tools/brotli.c","lineNumber":398,"sourceCode":"          continue;\n        } else if (c == 'n') {\n          if (!params->copy_stat) {\n            fprintf(stderr, \"argument --no-copy-stat / -n already set\\n\");\n            return COMMAND_INVALID;\n          }\n          params->copy_stat = BROTLI_FALSE;\n          continue;\n        } else if (c == 's') {\n          if (squash_set) {\n            fprintf(stderr, \"argument --squash / -s already set\\n\");\n            return COMMAND_INVALID;\n          }\n          squash_set = BROTLI_TRUE;\n          params->reject_uncompressible = BROTLI_TRUE;\n          continue;\n        } else if (c == 't') {\n          if (command_set) {\n            fprintf(stderr, \"command already set when parsing -t\\n\");\n            return COMMAND_INVALID;\n          }\n          command_set = BROTLI_TRUE;\n          command = COMMAND_TEST_INTEGRITY;\n          continue;\n        } else if (c == 'v') {\n          if (params->verbosity > 0) {\n            fprintf(stderr, \"argument --verbose / -v already set\\n\");\n            return COMMAND_INVALID;\n          }\n          params->verbosity = 1;\n          continue;\n        } else if (c == 'K') {\n          if (concatenated_set) {\n            fprintf(stderr, \"argument -K / --concatenated already set\\n\");\n            return COMMAND_INVALID;\n          }\n          concatenated_set = BROTLI_TRUE;","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/brotli/c/tools/brotli.c#L380-L416","documentation":"`-t`/`--test` (test archive integrity) is a command mode mutually exclusive with `-d` (decompress). Once a command mode is set, passing `-t` again is rejected.","triggerScenarios":"`brotli -t -d file`, `brotli -t -t file`, or coalesced `brotli -td file`.","commonSituations":"Alias that tests (`-t`) plus a user `-d`; a wrapper merging modes; assuming test+decompress can combine.","solutions":["Use exactly one command-mode flag (`-t` or `-d`).","Remove the conflicting mode from your alias or command."],"exampleFix":"// before\nbrotli -t -d file.br   # two command modes\n// after\nbrotli -t file.br      # test integrity only","handlingStrategy":"validation","validationCode":"modes=[a for a in argv if a in ('-d','-t','--decompress','--test') or (a.startswith('-') and not a.startswith('--') and ('d' in a or 't' in a))]\nassert len(modes) <= 1, 'only one command mode (-d/-t) allowed'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one mode per invocation.","Keep aliases free of hidden mode flags."],"tags":["brotli","cli","argument-parsing","mode"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}