jackwener/OpenCLI · error · ArgumentError
Use either --point or --radius, not both
Error message
Use either --point or --radius, not both
What it means
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.
Source
Thrown at clis/geogebra/add-circle.js:24
site: 'geogebra',
name: 'add-circle',
access: 'write',
description: 'Create a circle by center+radius or center+point',
domain: 'www.geogebra.org',
strategy: Strategy.PUBLIC,
browser: true,
navigateBefore: false,
example: 'opencli geogebra add-circle --center A --radius 3',
args: [
{ name: 'center', required: true, help: 'Center point label (e.g. A)' },
{ name: 'radius', required: false, help: 'Radius value (number) or a point label on the circle' },
{ name: 'point', required: false, help: 'Alternative: a point label on the circle (use instead of --radius for Circle(center,point))' },
],
columns: ['label', 'center', 'radius'],
func: async (page, kwargs) => {
const center = normalizeLabel(kwargs.center, 'center');
if (kwargs.point && kwargs.radius !== undefined) {
throw new ArgumentError('Use either --point or --radius, not both');
}
const pointOnCircle = kwargs.point ? normalizeLabel(kwargs.point, 'point') : '';
const radiusValue = kwargs.radius;
let cmd;
if (pointOnCircle) {
cmd = `Circle(${center},${pointOnCircle})`;
} else if (radiusValue !== undefined) {
const raw = String(radiusValue).trim();
const num = Number(raw);
cmd = Number.isFinite(num)
? `Circle(${center},${normalizeNumber(raw, 'radius', { positive: true })})`
: `Circle(${center},${normalizeLabel(raw, 'radius point')})`;
} else {
throw new ArgumentError('Provide --radius (number or point label) or --point (point on circle)');
}
await ensureApplet(page);View on GitHub (pinned to 49907e53dc)
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
Example fix
// before opencli geogebra add-circle --center A --point B --radius 5 // after opencli geogebra add-circle --center A --point B
Defensive patterns
Strategy: validation
Validate before calling
if (args.point != null && args.radius !== undefined) {
throw new Error('add-circle accepts --point or --radius, not both');
}
if (args.point == null && args.radius === undefined) {
throw new Error('add-circle requires --point or --radius');
} Prevention
- 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
When it happens
Trigger: Running add-circle with both flags set, e.g. --center A --point B --radius 5, detected at clis/geogebra/add-circle.js:24.
Common situations: Copy-pasting an example and leaving an extra flag; scripting the command with defaulted parameters that collide.
Related errors
- Provide --radius (number or point label) or --point (point o
- type must be one of: line, segment, ray
- command must contain at least one GeoGebra command
- type must be a GeoGebra object type like point, line, or cir
- <train-no> "${trainNo}" does not look like a 12306 internal
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/8922b2d759a837b9.
Report an issue: GitHub.