Skip to main content

solar_core/subcommand/
install.rs

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