feat: take the store root as an option

This commit is contained in:
2026-09-08 09:57:01 +00:00
parent 11ecd0ac89
commit 4b1e9d68b0
6 changed files with 59 additions and 22 deletions

View File

@@ -53,15 +53,22 @@ fn run(command: cli::Commands) -> Result<ExitCode> {
Ok(done)
}
cli::Commands::Link { command } => match command {
cli::Link::Add { paths, force } => scripts::link::add(&paths, force).map(|()| done),
cli::Link::Restore { paths, all } => scripts::link::restore(&paths, all).map(|()| done),
cli::Link::Add {
paths,
force,
store,
} => scripts::link::add(&paths, force, store.root.as_deref()).map(|()| done),
cli::Link::Restore { paths, all, store } => {
scripts::link::restore(&paths, all, store.root.as_deref()).map(|()| done)
}
// the one command with something to say through its exit code
cli::Link::Check {
paths,
porcelain,
null,
exit_code,
} => scripts::link::check(&paths, porcelain, null, exit_code),
store,
} => scripts::link::check(&paths, porcelain, null, exit_code, store.root.as_deref()),
},
cli::Commands::Completions { shell } => {
scripts::completions::completions(shell)?;