{"record":{"id":"2de594777a1f466c","repo":"yamadashy/repomix","slug":"invalid-number-for-include-logs-count-v-m","errorCode":null,"errorMessage":"Invalid number for --include-logs-count: '${v}'. Must be a non-negative integer.","messagePattern":"Invalid number for --include-logs-count: '(.+?)'\\. Must be a non-negative integer\\.","errorType":"validation","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/cli/cliRun.ts","lineNumber":150,"sourceCode":"        ).argParser(parseHumanSizeToBytes),\n      )\n      .option('--include-empty-directories', 'Include folders with no files in directory structure')\n      .option(\n        '--include-full-directory-structure',\n        'Show entire repository tree in the Directory Structure section, even when using --include patterns',\n      )\n      .option(\n        '--no-git-sort-by-changes',\n        \"Don't sort files by git change frequency (default: most changed files first)\",\n      )\n      .option('--include-diffs', 'Add git diff section showing working tree and staged changes')\n      .option('--include-logs', 'Add git commit history with messages and changed files')\n      .option(\n        '--include-logs-count <count>',\n        'Number of recent commits to include with --include-logs (default: 50)',\n        (v: string) => {\n          if (!/^\\d+$/.test(v)) {\n            throw new RepomixError(`Invalid number for --include-logs-count: '${v}'. Must be a non-negative integer.`);\n          }\n          return Number(v);\n        },\n      )\n      // File Selection Options\n      .optionsGroup('File Selection Options')\n      .option(\n        '--include <patterns>',\n        'Include only files matching these glob patterns (comma-separated, e.g., \"src/**/*.js,*.md\")',\n      )\n      .option('-i, --ignore <patterns>', 'Additional patterns to exclude (comma-separated, e.g., \"*.test.js,docs/**\")')\n      .option('--no-gitignore', \"Don't use .gitignore rules for filtering files\")\n      .option('--no-dot-ignore', \"Don't use .ignore rules for filtering files\")\n      .option('--no-default-patterns', \"Don't apply built-in ignore patterns (node_modules, .git, build dirs, etc.)\")\n      // Remote Repository Options\n      .optionsGroup('Remote Repository Options')\n      .option('--remote <url>', 'Clone and pack a remote repository (GitHub URL or user/repo format)')\n      .option('--remote-branch <name>', \"Specific branch, tag, or commit to use (default: repository's default branch)\")","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/cli/cliRun.ts#L132-L168","documentation":"`--include-logs-count` controls how many recent git commits are included with `--include-logs`. The CLI enforces `/^\\d+$/` (non-negative integer) in its parser, throwing this RepomixError for anything else.","triggerScenarios":"Passing `--include-logs-count` with a negative, decimal, or non-numeric value (e.g. `-5`, `50.0`, `all`), or the option consuming the next flag when the value is omitted.","commonSituations":"Users trying semantic values like `--include-logs-count all`, typos in scripts, or missing the value so the next flag is parsed as the count.","solutions":["Pass a plain non-negative integer: `--include-logs-count 50`","Omit the option entirely to use the default (50)","Verify script variables expand to valid integers"],"exampleFix":"// before\nrepomix --include-logs --include-logs-count all\n// after\nrepomix --include-logs --include-logs-count 100","handlingStrategy":"validation","validationCode":"const i = process.argv.indexOf('--include-logs-count');\nconst v = i !== -1 ? process.argv[i + 1] : undefined;\nif (v !== undefined && !/^\\d+$/.test(v)) {\n  throw new Error(`--include-logs-count needs a non-negative integer, got: ${v}`);\n}","typeGuard":"const isNonNegativeInt = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isInteger(v) && v >= 0;","tryCatchPattern":"try {\n  parseArgv(argv);\n} catch (e) {\n  if (e instanceof RepomixError && e.message.includes('--include-logs-count')) {\n    console.error('Usage: --include-logs-count 50 (non-negative integer)');\n  }\n  process.exitCode = 1;\n}","preventionTips":["Use plain integers only; omit the flag to accept the default (50)","Ensure the value immediately follows the flag so it isn't consumed from the next token"],"tags":["cli","argument-validation","option-parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}