mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-24 08:49:49 +00:00
fix(cli): clarify remaining required options
This commit is contained in:
@@ -232,7 +232,7 @@ export function registerCronAddCommand(cron: Command) {
|
||||
|
||||
const name = normalizeOptionalString(opts.name) ?? "";
|
||||
if (!name) {
|
||||
throw new Error("--name is required");
|
||||
throw new Error("Cron job name is required. Pass --name <name>.");
|
||||
}
|
||||
|
||||
const description = normalizeOptionalString(opts.description);
|
||||
|
||||
@@ -104,14 +104,14 @@ function resolveDirectSchedule(options: NormalizedScheduleOptions): CronSchedule
|
||||
if (options.at) {
|
||||
const atIso = parseAt(options.at, options.tz);
|
||||
if (!atIso) {
|
||||
throw new Error("Invalid --at; use ISO time or duration like 20m");
|
||||
throw new Error("Invalid --at. Use an ISO timestamp or a duration like 20m.");
|
||||
}
|
||||
return { kind: "at", at: atIso };
|
||||
}
|
||||
if (options.every) {
|
||||
const everyMs = parseDurationMs(options.every);
|
||||
if (!everyMs) {
|
||||
throw new Error("Invalid --every; use e.g. 10m, 1h, 1d");
|
||||
throw new Error("Invalid --every. Use a duration like 10m, 1h, or 1d.");
|
||||
}
|
||||
return { kind: "every", everyMs };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user