{"record":{"id":"1e3a959d78e84184","repo":"n8n-io/n8n","slug":"unknown-flag-arg-split-1-0-use-help-1e3a95","errorCode":null,"errorMessage":"Unknown flag: ${arg.split('=', 1)[0]} (use --help)","messagePattern":"Unknown flag: (.+?) \\(use --help\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/cli/langtracer-push.ts","lineNumber":111,"sourceCode":"\t\t\t\t}\n\t\t\t\tresult.setKind = value;\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--contains-user-data':\n\t\t\t\tresult.synthetic = false;\n\t\t\t\ti += 1;\n\t\t\t\tbreak;\n\t\t\tcase '--dry-run':\n\t\t\t\tresult.dryRun = true;\n\t\t\t\ti += 1;\n\t\t\t\tbreak;\n\t\t\tcase '-h':\n\t\t\tcase '--help':\n\t\t\t\treturn { helpRequested: true };\n\t\t\tdefault:\n\t\t\t\tif (arg.startsWith('--')) {\n\t\t\t\t\tthrow new Error(`Unknown flag: ${arg.split('=', 1)[0]} (use --help)`);\n\t\t\t\t}\n\t\t\t\tresult.slugs.push(arg);\n\t\t\t\ti += 1;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!result.suite) throw new Error('--suite <slug|id> is required');\n\tconst hasSelector =\n\t\tresult.slugs.length > 0 ||\n\t\tresult.changed ||\n\t\tresult.filter !== undefined ||\n\t\tresult.tier !== undefined;\n\tif (!hasSelector) {\n\t\tthrow new Error('select cases to push: pass <slugs...>, --changed, --filter, or --tier');\n\t}\n\n\treturn { helpRequested: false, args: result };","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/cli/langtracer-push.ts#L93-L129","documentation":"The langtracer-push CLI has a fixed set of recognized flags parsed in a switch statement. Any argument starting with '--' that does not match a known case falls through to the default branch, which throws this error naming the unrecognized flag and directing to --help. This prevents silent ignoring of typos that would change push behavior.","triggerScenarios":"Running `pnpm eval:langtracer-push --suite baseline --changed --dry-runn` (typo for --dry-run), or any unrecognized flag starting with '--'. The check at line 110 fires in the default case of the switch.","commonSituations":"Typo in a flag name. Using a flag from a different CLI (e.g. build-mcp-manifest's --source or --iterations). Version mismatch where a flag was added or removed. Copy-pasting a command from outdated documentation.","solutions":["Run with --help to see all supported flags and their exact spelling","Check the flag name against the help text and correct the typo","Remove the unsupported flag if it was accidental"],"exampleFix":"# before\npnpm eval:langtracer-push --suite baseline --changed --dry-runn\n\n# after\npnpm eval:langtracer-push --suite baseline --changed --dry-run","handlingStrategy":"validation","validationCode":"const KNOWN_FLAGS = new Set(['--suite', '--filter', '--exclude', '--tier', '--changed', '--set-kind', '--contains-user-data', '--dry-run', '-h', '--help']);\nfor (const arg of argv) {\n  if (arg.startsWith('--') && !KNOWN_FLAGS.has(arg.split('=')[0])) {\n    throw new Error(`Unknown flag: ${arg.split('=')[0]}. Run with --help for valid flags.`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run with --help to see the exact flag names before composing a command","Watch for typos in flag names","Do not mix flags from different CLI tools"],"tags":["cli","validation","argument-parsing","langtracer-push"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}