mirror of
https://github.com/ouch-org/ouch.git
synced 2025-07-23 18:10:22 +00:00
cli: refactor path canonicalizing logic
This commit is contained in:
parent
38e7009a27
commit
3cb0bfa1e5
11
src/cli.rs
11
src/cli.rs
@ -135,13 +135,10 @@ pub fn parse_args_from(mut args: Vec<OsString>) -> crate::Result<ParsedArgs> {
|
||||
// Parse flags
|
||||
let (args, mut flags) = oof::filter_flags(args, &flags_info)?;
|
||||
|
||||
let files = args.into_iter().map(canonicalize);
|
||||
for file in files.clone() {
|
||||
if let Err(err) = file {
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
let files = files.map(Result::unwrap).collect();
|
||||
let files = args
|
||||
.into_iter()
|
||||
.map(canonicalize)
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
let output_folder = flags.take_arg("output").map(PathBuf::from);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user