mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
Merge pull request #5764 from cakebaker/mv_simplify_condition
mv: simplify condition
This commit is contained in:
commit
97cb2b2de6
1 changed files with 7 additions and 13 deletions
|
@ -128,13 +128,13 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let mut app = uu_app();
|
let mut app = uu_app();
|
||||||
let matches = app.try_get_matches_from_mut(args)?;
|
let matches = app.try_get_matches_from_mut(args)?;
|
||||||
|
|
||||||
if !matches.contains_id(OPT_TARGET_DIRECTORY)
|
let files: Vec<OsString> = matches
|
||||||
&& matches
|
.get_many::<OsString>(ARG_FILES)
|
||||||
.get_many::<OsString>(ARG_FILES)
|
.unwrap_or_default()
|
||||||
.map(|f| f.len())
|
.cloned()
|
||||||
.unwrap_or(0)
|
.collect();
|
||||||
== 1
|
|
||||||
{
|
if files.len() == 1 && !matches.contains_id(OPT_TARGET_DIRECTORY) {
|
||||||
app.error(
|
app.error(
|
||||||
ErrorKind::TooFewValues,
|
ErrorKind::TooFewValues,
|
||||||
format!(
|
format!(
|
||||||
|
@ -144,12 +144,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
.exit();
|
.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
let files: Vec<OsString> = matches
|
|
||||||
.get_many::<OsString>(ARG_FILES)
|
|
||||||
.unwrap_or_default()
|
|
||||||
.cloned()
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
let overwrite_mode = determine_overwrite_mode(&matches);
|
let overwrite_mode = determine_overwrite_mode(&matches);
|
||||||
let backup_mode = backup_control::determine_backup_mode(&matches)?;
|
let backup_mode = backup_control::determine_backup_mode(&matches)?;
|
||||||
let update_mode = update_control::determine_update_mode(&matches);
|
let update_mode = update_control::determine_update_mode(&matches);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue