diff --git a/src/uu/df/src/df.rs b/src/uu/df/src/df.rs index 3346fe41d..5bfe17a99 100644 --- a/src/uu/df/src/df.rs +++ b/src/uu/df/src/df.rs @@ -24,6 +24,7 @@ use uucore::{format_usage, show}; use clap::{crate_version, Arg, ArgMatches, Command, ValueSource}; use std::error::Error; +use std::ffi::OsString; use std::fmt; use std::path::Path; @@ -172,8 +173,12 @@ impl fmt::Display for OptionsError { impl Options { /// Convert command-line arguments into [`Options`]. fn from(matches: &ArgMatches) -> Result { - let include = matches.values_of_lossy(OPT_TYPE); - let exclude = matches.values_of_lossy(OPT_EXCLUDE_TYPE); + let include: Option> = matches + .get_many::(OPT_TYPE) + .map(|v| v.map(|s| s.to_string_lossy().to_string()).collect()); + let exclude: Option> = matches + .get_many::(OPT_EXCLUDE_TYPE) + .map(|v| v.map(|s| s.to_string_lossy().to_string()).collect()); if let (Some(include), Some(exclude)) = (&include, &exclude) { if let Some(types) = Self::get_intersected_types(include, exclude) {