From e6d846dc50abbfb255942d7a1470850b3443e5a3 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Thu, 1 Sep 2016 01:17:43 -0700 Subject: [PATCH] Rename arg --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9eba28d..92b3051 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ fn main() { .author(crate_authors!()) .about("Rm ImProved Send files to the graveyard (/tmp/.graveyard) instead of unlinking them.") - .arg(Arg::with_name("TARGET") + .arg(Arg::with_name("SOURCE") .help("File or directory to remove") .required(true) .multiple(true) @@ -29,7 +29,7 @@ Send files to the graveyard (/tmp/.graveyard) instead of unlinking them.") let graveyard: &Path = Path::new(matches.value_of("graveyard") .unwrap_or(GRAVEYARD)); - let sources: clap::Values = matches.values_of("TARGET").unwrap(); + let sources: clap::Values = matches.values_of("SOURCE").unwrap(); for source in sources { send_to_graveyard(source, graveyard); @@ -37,7 +37,7 @@ Send files to the graveyard (/tmp/.graveyard) instead of unlinking them.") } fn send_to_graveyard(source: &str, graveyard: &Path) { - let mut fullpath: PathBuf = current_dir().expect("Does current dir exist?"); + let mut fullpath: PathBuf = current_dir().expect("Current dir error"); fullpath.push(Path::new(source)); let parent: &Path = fullpath.parent().expect("Trying to delete / ?"); let dest: PathBuf = graveyard.join(parent.strip_prefix("/").unwrap());