affaan-m/ECC · error · Error
Missing value for ${option}.
Error message
Missing value for ${option}. What it means
readValue reads the token immediately after --terminal or --cwd. If that next token is undefined (the option was last in argv) or itself starts with '--' (looks like another flag), the value is considered missing and rejected. This prevents silently consuming a following flag as a path or terminal name.
Source
Thrown at skills/terminal-opener/scripts/open-terminal.js:83
);
}
if (!resemblesExecutablePath && /[;&|<>`$]/.test(value)) {
throw new Error(
'Executable must be one argv entry, not an interpolated shell command string.'
);
}
}
function validateArgv(argv) {
for (const argument of argv) {
if (argument.includes('\0')) throw new Error('Arguments must not contain NUL bytes.');
}
}
function readValue(argv, index, option) {
const value = argv[index + 1];
if (value === undefined || value.startsWith('--')) {
throw new Error(`Missing value for ${option}.`);
}
return value;
}
function parseArgs(argv, context = {}) {
const env = context.env || process.env;
const initialTerminal = env.ECC_TERMINAL || DEFAULT_TERMINAL;
const initialCwd = context.cwd || process.cwd();
const options = {
argv: [],
cwd: initialCwd,
detect: false,
dryRun: true,
executable: undefined,
help: false,
json: false,
mode: 'normal',
terminal: initialTerminal,View on GitHub (pinned to 01e15490f0)
Solutions
- Supply a concrete value immediately after --terminal or --cwd.
- Make sure the value does not itself start with '--'; if a path legitimately starts with '--', pass it via env (ECC_TERMINAL) or restructure.
- Check the command line for a missing or misplaced token.
Example fix
# before node open-terminal.js --cwd --launch -- echo hi # after node open-terminal.js --cwd /tmp --launch -- echo hi
Defensive patterns
Strategy: validation
Validate before calling
function readOptionValue(argv, index, option) {
const value = argv[index + 1];
if (value === undefined || value.startsWith('--')) {
throw new Error(`Missing value for ${option}`);
}
return value;
} Prevention
- Always supply a concrete value immediately after --terminal or --cwd.
- In scripts, validate that the expected value token exists before invoking.
When it happens
Trigger: --terminal or --cwd is the last token (no value follows), or the token after it begins with '--' (e.g. '--cwd --launch'). readValue is called from parseArgs for those two options.
Common situations: Typo or truncated command line; forgetting to supply the value; a flag accidentally placed where the value should go; scripting that joins flags incorrectly.
Related errors
- Invalid terminal name; use a simple adapter name such as wez
- Unknown option "${argument}"; put the executable after --.
- --launch and --dry-run are mutually exclusive.
- An executable is required after --.
- Multiple ECC repo roots detected: ${uniqueRepoRoots.join(',
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/0ba451fb5395af49.
Report an issue: GitHub.