Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the -n, --no flag usage and add an alias for the compress subcommand #22

Merged
merged 4 commits into from
Apr 9, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cli: refactor path canonicalizing logic
  • Loading branch information
vrmiguel committed Apr 9, 2021
commit 3cb0bfa1e570d27db2833ee3ec288606178c6c26
11 changes: 4 additions & 7 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down