git_stk/commands/up.rs
1use anyhow::Result;
2use clap_complete::engine::ArgValueCompleter;
3
4use crate::commands::Run;
5use crate::completions;
6
7/// Move up the stack: check out a child of the current branch.
8#[derive(Debug, clap::Args)]
9pub struct Up {
10 #[arg(add = ArgValueCompleter::new(completions::child_branch_candidates))]
11 branch: Option<String>,
12}
13
14impl Run for Up {
15 fn run(self) -> Result<()> {
16 crate::stack::checkout_child(self.branch.as_deref())
17 }
18}