solar-core 0.0.0

Core library for cargo-solar command.
Documentation
use std::path::PathBuf;

use clap::Parser;

use crate::{Action, Tool, SolarError};

#[derive(Parser, Clone)]
pub struct Install {
    /// The name of the tool to install.
    #[command(subcommand)]
    tool: Option<Tool>,

    /// The destination to install the tools to.
    #[arg(short, long, default_value = ".")]
    destination: PathBuf,
}

impl Install {
    pub fn run(&self) -> Result<(), SolarError> {
        Tool::perform(&self.tool, Action::INSTALL)
    }
}