Skip to main content

apm/cmd/
state.rs

1use anyhow::Result;
2use std::path::Path;
3
4pub fn run(root: &Path, id_arg: &str, new_state: String, no_aggressive: bool, force: bool) -> Result<()> {
5    let out = apm_core::state::transition(root, id_arg, new_state, no_aggressive, force)?;
6    println!("{}: {} → {}", out.id, out.old_state, out.new_state);
7    if let Some(wt) = out.worktree_path {
8        println!("{}", wt.display());
9    }
10    for msg in &out.messages {
11        println!("{msg}");
12    }
13    for w in &out.warnings {
14        eprintln!("{w}");
15    }
16    Ok(())
17}