diff --git a/src/args.rs b/src/args.rs index 77421c4b8..04b42066b 100644 --- a/src/args.rs +++ b/src/args.rs @@ -344,6 +344,16 @@ impl<'a> ArgMatches<'a> { if paths.is_empty() { paths.push(self.default_path()); } + + for path in &mut paths { + use std::fs::canonicalize; + use std::mem::replace; + + if let Ok(canon) = canonicalize(&path) { + replace(path, canon); + } + } + paths }