{"record":{"id":"10ad2a055358de03","repo":"Hmbown/CodeWhale","slug":"unknown-argument-arg","errorCode":null,"errorMessage":"unknown argument: ${arg}","messagePattern":"unknown argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"integrations/feishu-bridge/scripts/validate-config.mjs","lineNumber":72,"sourceCode":"      case \"--runtime-env\":\n        parsed.runtimeEnv = argv[++index];\n        break;\n      case \"--workspace-root\":\n        parsed.workspaceRoot = argv[++index];\n        break;\n      case \"--check-filesystem\":\n        parsed.checkFilesystem = true;\n        break;\n      case \"--json\":\n        parsed.json = true;\n        break;\n      case \"-h\":\n      case \"--help\":\n        printHelp();\n        process.exit(0);\n        break;\n      default:\n        throw new Error(`unknown argument: ${arg}`);\n    }\n  }\n  return parsed;\n}\n\nasync function appendFilesystemChecks(result, env, args) {\n  const workspace = cleanEnvValue(env.CODEWHALE_WORKSPACE ?? env.DEEPSEEK_WORKSPACE);\n  if (workspace) {\n    await checkReadableDirectory(result, workspace, \"workspace\");\n  }\n\n  const threadMapPath = cleanEnvValue(env.FEISHU_THREAD_MAP_PATH);\n  if (threadMapPath) {\n    const parent = path.dirname(threadMapPath);\n    await checkWritableDirectory(result, parent, \"thread map directory\");\n  }\n\n  if (args.env) {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/integrations/feishu-bridge/scripts/validate-config.mjs#L54-L90","documentation":"validate-config.mjs walks argv against a fixed switch (--check-filesystem, --json, -h/--help, and the earlier declared flags); anything else - a typo, an unquoted value splitting into two tokens, or a flag renamed between versions - reaches the default case and throws `unknown argument: <arg>`.","triggerScenarios":"Running the validator with a misspelled flag (e.g. --check-fs), passing a positional argument, or shell expansion injecting extra tokens.","commonSituations":"Copy-pasted commands from outdated docs; CI scripts referencing flags renamed in a newer revision; unquoted env-derived values.","solutions":["Run with -h/--help to print the accepted flags","Correct the flag spelling and quote values that may contain spaces","Update scripts still passing flags from an older revision"],"exampleFix":"# before\nnode scripts/validate-config.mjs --check-fs --json\n\n# after\nnode scripts/validate-config.mjs --check-filesystem --json","handlingStrategy":"validation","validationCode":"// mirror the switch cases in validate-config.mjs and keep them in sync\nconst ALLOWED = new Set(['--check-env', '--check-filesystem', '--json', '-h', '--help']);\nfor (const arg of process.argv.slice(2)) {\n  if (!ALLOWED.has(arg)) {\n    printHelp();\n    console.error(`unknown argument: ${arg}`);\n    process.exit(2);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the script with --help when in doubt about flags","Quote shell arguments that may contain spaces","Update docs and CI invocations together when flags change"],"tags":["cli","config","usage"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}