solar_core/subcommand/upgrade.rs
1use std::path::PathBuf;
2
3use clap::Parser;
4
5use crate::{Action, Tool, SolarError};
6
7#[derive(Parser, Clone)]
8pub struct Upgrade {
9 /// The name of the tool to upgrade. If none is provided, defaults to all tools.
10 #[command(subcommand)]
11 tool: Option<Tool>,
12
13 /// The destination to upgrade the tools from.
14 #[arg(short, long, default_value = ".")]
15 destination: PathBuf,
16}
17
18impl Upgrade {
19 pub fn run(&self) -> Result<(), SolarError> {
20 Tool::perform(&self.tool, Action::UPGRADE)
21 }
22}