From 6817631ddee3795af3a558bf38e477da4ae5b1cb Mon Sep 17 00:00:00 2001 From: diogo464 Date: Fri, 24 Dec 2021 21:09:44 +0000 Subject: made install-path a global option --- dotup_cli/src/commands/uninstall.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'dotup_cli/src/commands/uninstall.rs') diff --git a/dotup_cli/src/commands/uninstall.rs b/dotup_cli/src/commands/uninstall.rs index fdb1a0a..fe44bf0 100644 --- a/dotup_cli/src/commands/uninstall.rs +++ b/dotup_cli/src/commands/uninstall.rs @@ -9,26 +9,17 @@ use super::prelude::*; /// Symlinks are only deleted if they were pointing to the correct file. #[derive(Parser)] pub struct Opts { - /// The location where links will be uninstalled from. - /// Defaults to home directory. - #[clap(long)] - install_base: Option, - /// The files/directories to uninstall. #[clap(min_values = 1, default_value = ".")] paths: Vec, } pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { - let install_base = match opts.install_base { - Some(path) => path, - None => utils::home_directory()?, - }; let depot = utils::read_depot(&config.archive_path)?; for link in utils::collect_links_by_base_paths(&depot, &opts.paths) { log::info!("Uninstalling link : {}", link); - depot.uninstall_link(link, &install_base)?; + depot.uninstall_link(link, &config.install_path)?; } Ok(()) -- cgit