{"record":{"id":"ffdd518ce1602685","repo":"jackwener/OpenCLI","slug":"provide-radius-number-or-point-label-or-poin","errorCode":null,"errorMessage":"Provide --radius (number or point label) or --point (point on circle)","messagePattern":"Provide --radius \\(number or point label\\) or --point \\(point on circle\\)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/geogebra/add-circle.js","lineNumber":39,"sourceCode":"  func: async (page, kwargs) => {\n    const center = normalizeLabel(kwargs.center, 'center');\n    if (kwargs.point && kwargs.radius !== undefined) {\n      throw new ArgumentError('Use either --point or --radius, not both');\n    }\n    const pointOnCircle = kwargs.point ? normalizeLabel(kwargs.point, 'point') : '';\n    const radiusValue = kwargs.radius;\n\n    let cmd;\n    if (pointOnCircle) {\n      cmd = `Circle(${center},${pointOnCircle})`;\n    } else if (radiusValue !== undefined) {\n      const raw = String(radiusValue).trim();\n      const num = Number(raw);\n      cmd = Number.isFinite(num)\n        ? `Circle(${center},${normalizeNumber(raw, 'radius', { positive: true })})`\n        : `Circle(${center},${normalizeLabel(raw, 'radius point')})`;\n    } else {\n      throw new ArgumentError('Provide --radius (number or point label) or --point (point on circle)');\n    }\n\n    await ensureApplet(page);\n    const result = requireGgbSuccess(await ggbEval(page, cmd), `Failed to create circle: ${cmd}`);\n    return [{ label: result.label, center, radius: pointOnCircle || radiusValue }];\n  },\n});\n","sourceCodeStart":21,"sourceCodeEnd":47,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/geogebra/add-circle.js#L21-L47","documentation":"ArgumentError thrown by geogebra add-circle when neither --radius nor --point is provided; the command has no way to construct a Circle command without a size definition.","triggerScenarios":"Running add-circle with only --center (or nothing sizing-related), reaching the else branch at clis/geogebra/add-circle.js:39.","commonSituations":"Forgetting the sizing flag; a wrapper script dropping empty/undefined arguments before invoking the CLI.","solutions":["Add --radius <number or point label> (e.g. --radius 5 or --radius B)","Or add --point <label of a point on the circle> (e.g. --point B)"],"exampleFix":"// before\nopencli geogebra add-circle --center A\n// after\nopencli geogebra add-circle --center A --radius 5","handlingStrategy":"validation","validationCode":"if (args.radius === undefined && !args.point) {\n  throw new Error('add-circle requires --radius (number or point label) or --point');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a sizing flag with add-circle","Check shell quoting so flags are not silently dropped","Add a wrapper-level check before invoking the CLI"],"tags":["cli","argument-validation","geogebra"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}