feat(cron): add cron update CLI subcommand for in-place job updates
Add Update variant to CronCommands in both main.rs and lib.rs, with handler in cron/mod.rs that constructs a CronJobPatch and calls update_job(). Includes security policy check for command changes. Fixes from review feedback: - --tz alone now correctly updates timezone (fetches existing schedule) - --expression alone preserves existing timezone instead of clearing it - All-None patch (no flags) now returns an error - Output uses consistent emoji prefix Tests exercise handle_command directly to cover schedule construction. Closes #809 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0910f2a710
commit
8b4607a1ef
4 changed files with 283 additions and 2 deletions
17
src/lib.rs
17
src/lib.rs
|
|
@ -186,6 +186,23 @@ pub enum CronCommands {
|
|||
/// Task ID
|
||||
id: String,
|
||||
},
|
||||
/// Update a scheduled task
|
||||
Update {
|
||||
/// Task ID
|
||||
id: String,
|
||||
/// New cron expression
|
||||
#[arg(long)]
|
||||
expression: Option<String>,
|
||||
/// New IANA timezone
|
||||
#[arg(long)]
|
||||
tz: Option<String>,
|
||||
/// New command to run
|
||||
#[arg(long)]
|
||||
command: Option<String>,
|
||||
/// New job name
|
||||
#[arg(long)]
|
||||
name: Option<String>,
|
||||
},
|
||||
/// Pause a scheduled task
|
||||
Pause {
|
||||
/// Task ID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue