{"record":{"id":"79eff2ba82788459","repo":"affaan-m/ECC","slug":"command-does-not-accept-positional-arguments","errorCode":null,"errorMessage":"${command} does not accept positional arguments.","messagePattern":"(.+?) does not accept positional arguments\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"scripts/memory.js","lineNumber":135,"sourceCode":"        skipNext: true,\n      };\n    }\n    if (argument.startsWith('-')) {\n      throw new Error(`Unknown option: ${argument}`);\n    }\n    return { ...state, positionals: [...state.positionals, argument] };\n  }, { options: {}, positionals: [], skipNext: false });\n\n  return {\n    command,\n    options: parsed.options,\n    positionals: parsed.positionals,\n  };\n}\n\nfunction requireNoPositionals(positionals, command) {\n  if (positionals.length > 0) {\n    throw new Error(`${command} does not accept positional arguments.`);\n  }\n}\n\nfunction oneValue(values, label, fallback = null) {\n  if (!values || values.length === 0) return fallback;\n  if (values.length > 1) {\n    throw new Error(`${label} may be provided only once.`);\n  }\n  return values[0];\n}\n\nfunction waitForStdinRetry(milliseconds) {\n  Atomics.wait(STDIN_RETRY_SIGNAL, 0, 0, milliseconds);\n}\n\nfunction readBoundedStdin(maxBytes, retryOptions = {}) {\n  const retryDelayMs = Number.isInteger(retryOptions.retryDelayMs)\n    && retryOptions.retryDelayMs > 0","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/memory.js#L117-L153","documentation":"requireNoPositionals throws `${command} does not accept positional arguments.` when a command that takes only flags receives bare tokens. It is applied to the init, save, handoff, and doctor commands. By contrast search and read DO take positionals (the query / the memory id), so this fires only on the no-positional commands.","triggerScenarios":"Running `ecc memory init project` (init takes no positionals — scope is a flag). Running `ecc memory save my-note.md` (save takes --body-file, not a positional). Running `ecc memory doctor project`. A trailing filename left after removing a flag during editing.","commonSituations":"Assuming positional shortcuts where the CLI only has flags. Copying a pattern from `memory read <id>` into `memory save <file>`.","solutions":["For init/doctor, pass scope as a flag: `--scope project`.","For save/handoff, supply the body via `--stdin` or `--body-file <path>` and the title via `--title`.","Remove any stray positional tokens from the command line.","Use `ecc memory search <query>` or `ecc memory read <id>` when you actually have a positional."],"exampleFix":"# before\necc memory save release-notes.md\n\n# after\necc memory save --title \"Release notes\" --body-file release-notes.md","handlingStrategy":"validation","validationCode":"const NO_POSITIONAL = new Set(['init','save','handoff','doctor']);\nfunction validatePositionals(command, positionals) {\n  if (NO_POSITIONAL.has(command) && positionals.length > 0) {\n    throw new Error(`${command} does not accept positional arguments.`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try { runCommand(parsed); }\ncatch (err) { if (/does not accept positional arguments\\./.test(err.message)) { usage(2); } else throw err; }","preventionTips":["init/doctor: pass scope via --scope, not as a positional.","save/handoff: pass the body via --stdin or --body-file.","Only search (query) and read (memory id) accept positionals."],"tags":["cli","argument-parsing","memory-vault","usage"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}