{"record":{"id":"7b9d192bfba131b4","repo":"affaan-m/ECC","slug":"unknown-nasiko-status-argument-argument","errorCode":null,"errorMessage":"Unknown Nasiko status argument: ${argument}","messagePattern":"Unknown Nasiko status argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/nasiko.js","lineNumber":96,"sourceCode":"}\n\nfunction readStatus(options = {}) {\n  const executable = resolveExecutable(options);\n  if (!executable) return { installed: false, qualified: false, version: null, executable: null };\n  return inspectInstalledNasiko(executable);\n}\n\nfunction parseStatusArguments(argumentsList) {\n  let options = { installDir: undefined, json: false };\n  for (let index = 0; index < argumentsList.length; index += 1) {\n    const argument = argumentsList[index];\n    if (argument === '--json') options = { ...options, json: true };\n    else if (argument === '--install-dir') {\n      const value = argumentsList[index + 1];\n      if (!value || value.startsWith('--')) throw new Error('Missing value for --install-dir.');\n      options = { ...options, installDir: validateInstallDirectory(value) };\n      index += 1;\n    } else throw new Error(`Unknown Nasiko status argument: ${argument}`);\n  }\n  return options;\n}\n\nasync function main(argumentsList = process.argv.slice(2)) {\n  const [command, ...rest] = argumentsList;\n  if (!command || command === '--help' || command === '-h' || command === 'help') {\n    process.stdout.write(helpText());\n    return 0;\n  }\n  if (command === 'status') {\n    const options = parseStatusArguments(rest);\n    const status = readStatus(options);\n    if (options.json) process.stdout.write(`${JSON.stringify(status, null, 2)}\\n`);\n    else process.stdout.write(status.qualified\n      ? `Qualified Nasiko ${status.version} is installed at ${status.executable}.\\n`\n      : status.installed\n        ? `An unqualified Nasiko file exists at ${status.executable}; it was not executed.\\n`","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/nasiko.js#L78-L114","documentation":"The `status` subcommand only accepts --json and --install-dir. parseStatusArguments throws this error for any other token, keeping the status parser strict so typos fail fast instead of being ignored. The offending argument is interpolated into the message.","triggerScenarios":"Running `nasiko status --verbose`, `nasiko status -h`, or a mutation-only flag like `--version v0.1.0` against the status command; any unrecognized token in the status argument list.","commonSituations":"Copying flags from the install/uninstall command into status (e.g. --version, which status does not need); typos like --instal-dir; passing subcommand-agnostic flags like --help that this minimal parser does not implement.","solutions":["Use only --json and --install-dir <path> with the status command.","Remove flags like --version that belong to install/uninstall.","Fix typos in the flag name.","Check the usage text printed by the script for the exact accepted flags."],"exampleFix":"// before\nnode scripts/nasiko.js status --version v0.1.0\n// after\nnode scripts/nasiko.js status --json","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['--json','--install-dir']);\nconst bad = args.filter(a => a.startsWith('--') && !ALLOWED.has(a));\nif (bad.length) throw new Error(`status accepts only --json and --install-dir, got: ${bad.join(' ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  runNasiko(['status', ...statusArgs]);\n} catch (err) {\n  if (err.message.startsWith('Unknown Nasiko status argument')) {\n    console.error('Use only --json and --install-dir with nasiko status.');\n  } else throw err;\n}","preventionTips":["Memorize/limit status flags to --json and --install-dir.","Don't copy install/uninstall flags (like --version) onto status.","Double-check flag spelling before running.","Keep command templates per subcommand to avoid flag bleed."],"tags":["cli","unknown-argument","parsing"],"backgroundTag":"invalid-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"}