{"record":{"id":"8922b2d759a837b9","repo":"jackwener/OpenCLI","slug":"use-either-point-or-radius-not-both","errorCode":null,"errorMessage":"Use either --point or --radius, not both","messagePattern":"Use either --point or --radius, not both","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/geogebra/add-circle.js","lineNumber":24,"sourceCode":"  site: 'geogebra',\n  name: 'add-circle',\n  access: 'write',\n  description: 'Create a circle by center+radius or center+point',\n  domain: 'www.geogebra.org',\n  strategy: Strategy.PUBLIC,\n  browser: true,\n  navigateBefore: false,\n  example: 'opencli geogebra add-circle --center A --radius 3',\n  args: [\n    { name: 'center', required: true, help: 'Center point label (e.g. A)' },\n    { name: 'radius', required: false, help: 'Radius value (number) or a point label on the circle' },\n    { name: 'point', required: false, help: 'Alternative: a point label on the circle (use instead of --radius for Circle(center,point))' },\n  ],\n  columns: ['label', 'center', 'radius'],\n  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);","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/geogebra/add-circle.js#L6-L42","documentation":"ArgumentError thrown by the geogebra add-circle command when the user supplies both --point and --radius. The two flags are alternative ways to define the circle (Circle(center,point) vs Circle(center,radius)) and are mutually exclusive by design.","triggerScenarios":"Running add-circle with both flags set, e.g. --center A --point B --radius 5, detected at clis/geogebra/add-circle.js:24.","commonSituations":"Copy-pasting an example and leaving an extra flag; scripting the command with defaulted parameters that collide.","solutions":["Remove one of the two flags: keep --point for Circle(center,point) or --radius for Circle(center,radius)","Fix the calling script so only one sizing parameter is passed"],"exampleFix":"// before\nopencli geogebra add-circle --center A --point B --radius 5\n// after\nopencli geogebra add-circle --center A --point B","handlingStrategy":"validation","validationCode":"if (args.point != null && args.radius !== undefined) {\n  throw new Error('add-circle accepts --point or --radius, not both');\n}\nif (args.point == null && args.radius === undefined) {\n  throw new Error('add-circle requires --point or --radius');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass exactly one sizing parameter when scripting add-circle","Use --radius for numeric sizes, --point when a defining point exists","Sanitize script defaults so unused flags are omitted, not passed as empty"],"tags":["cli","argument-validation","geogebra"],"backgroundTag":"mutually-exclusive-arguments","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}