{"record":{"id":"fa05dcb182f1f303","repo":"saadeghi/daisyui","slug":"too-many-positional-arguments","errorCode":null,"errorMessage":"Too many positional arguments","messagePattern":"Too many positional arguments","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":124,"sourceCode":"        positional.push(argument)\n    }\n  }\n\n  if (options.html !== undefined && options.htmlFile !== undefined) {\n    throw new Error(\"Use either --html or --html-file, not both\")\n  }\n  if (options.css !== undefined && options.cssFile !== undefined) {\n    throw new Error(\"Use either --css or --css-file, not both\")\n  }\n\n  if (options.html === undefined && options.htmlFile === undefined && positional.length > 0) {\n    options.html = positional.shift()\n  }\n  if (options.css === undefined && options.cssFile === undefined && positional.length > 0) {\n    options.css = positional.shift()\n  }\n  if (positional.length > 0) {\n    throw new Error(\"Too many positional arguments\")\n  }\n\n  return options\n}\n\nasync function readStdin() {\n  let input = \"\"\n  for await (const chunk of process.stdin) {\n    input += chunk\n  }\n  return input\n}\n\nasync function resolveInput(options) {\n  let html = options.html\n  let css = options.css\n\n  if (options.htmlFile !== undefined) {","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L106-L142","documentation":"After assigning the first positional to HTML and the second to CSS, any remaining positional token is rejected. The script accepts at most two bare positional arguments.","triggerScenarios":"Three or more positional tokens on the command line, e.g. `index.mjs a b c`.","commonSituations":"Forgetting to flag later arguments; a shell glob expanding into multiple tokens; passing extra args meant for another tool.","solutions":["Convert the extras to flagged options (--html/--css) or remove them.","Quote/guard shell globs so they do not expand unexpectedly.","Move extra arguments after `--` only if they are truly meant as HTML/CSS content."],"exampleFix":"# before\nbun .../index.mjs '<div/>' '@import \"tailwindcss\";' extra\n# after\nbun .../index.mjs '<div/>' '@import \"tailwindcss\";'","handlingStrategy":"validation","validationCode":"// After assigning html/css from positionals, reject leftovers.\nif (positional.length > 0) {\n  throw new Error(`Too many positional arguments: ${positional.join(' ')}`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use flags for anything beyond the first two positional tokens.","Quote shell arguments to prevent unintended glob expansion.","Keep the positional form to exactly html then css."],"tags":["cli","argument","parsing"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}