{"record":{"id":"373e73801b6ccf70","repo":"affaan-m/ECC","slug":"missing-value-for-locale","errorCode":null,"errorMessage":"Missing value for --locale","messagePattern":"Missing value for --locale","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install/request.js","lineNumber":70,"sourceCode":"    } else if (arg === '--with') {\n      const componentId = args[index + 1] || '';\n      if (componentId.trim()) {\n        parsed.includeComponentIds.push(componentId.trim());\n      }\n      index += 1;\n    } else if (arg === '--skill' || arg === '--skills') {\n      parsed.includeComponentIds.push(...normalizeSkillComponentIds(args[index + 1] || ''));\n      index += 1;\n    } else if (arg === '--without') {\n      const componentId = args[index + 1] || '';\n      if (componentId.trim()) {\n        parsed.excludeComponentIds.push(componentId.trim());\n      }\n      index += 1;\n    } else if (arg === '--locale') {\n      const locale = args[index + 1] || '';\n      if (!locale || locale.startsWith('--')) {\n        throw new Error('Missing value for --locale');\n      }\n      parsed.locale = locale;\n      index += 1;\n    } else if (arg === '--enable-hooks') {\n      parsed.enableHooks = true;\n    } else if (arg === '--no-hooks') {\n      parsed.noHooks = true;\n    } else if (arg === '--dry-run') {\n      parsed.dryRun = true;\n    } else if (arg === '--json') {\n      parsed.json = true;\n    } else if (arg === '--help' || arg === '-h') {\n      parsed.help = true;\n    } else if (arg.startsWith('--')) {\n      throw new Error(`Unknown argument: ${arg}`);\n    } else {\n      parsed.languages.push(arg);\n    }","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install/request.js#L52-L88","documentation":"parseInstallArgs validates CLI arguments in lockstep. When it sees `--locale`, it expects a following token that is a non-empty value not starting with `--`. If the next argument is missing, empty, or is another flag (e.g. `--locale --json`), it throws 'Missing value for --locale'.","triggerScenarios":"Running the installer with `--locale` as the last argument, `--locale` followed by nothing (`args[index+1]` is undefined → ''), or `--locale` immediately followed by another `--flag`.","commonSituations":"Truncating a command in a script (`--locale` with the value on the next line); shell quoting mistakes dropping the value; copy-pasting a flag list where the locale value was lost; forgetting that locale codes like `zh-CN` must not be confused with flags.","solutions":["Pass the locale value right after the flag: `--locale zh-CN`.","Quote the value if it contains special characters: `--locale \"pt-BR\"`.","Check shell line continuations — ensure the value isn't separated onto a broken line.","Run with `--help` to see the expected flag/value syntax."],"exampleFix":"// before\ninstall --target claude --locale --json\n\n// after\ninstall --target claude --locale zh-CN --json","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--locale');\nif (i !== -1) {\n  const v = argv[i + 1];\n  if (!v || v.startsWith('--')) throw new Error('--locale requires a value, e.g. --locale zh-CN');\n}","typeGuard":"null","tryCatchPattern":"try {\n  const request = parseInstallArgs(process.argv.slice(2));\n} catch (e) {\n  if (e.message === 'Missing value for --locale') {\n    console.error('Usage: install --locale <supported-locale>');\n    process.exitCode = 2;\n    return;\n  }\n  throw e;\n}","preventionTips":["Always put the locale value immediately after the flag on the same command line.","Quote locale values containing hyphens or shell-special characters.","Build install commands programmatically to avoid dropped tokens.","Smoke-test scripts with `--help` and a dry run before production use."],"tags":["cli","argument-parsing","locale"],"backgroundTag":"missing-cli-argument","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}