Skip to content

Commit

Permalink
Fix too aggressive config validation
Browse files Browse the repository at this point in the history
  • Loading branch information
pkolaczk committed Sep 26, 2021
1 parent 31e82ec commit 68fc34f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub struct GroupConfig {
pub hard_links: bool,

/// Don't count matching files found within the same directory argument as duplicates.
#[structopt(short("I"), long)]
#[structopt(short("I"), long, conflicts_with("follow-links"))]
pub isolate: bool,

/// Before matching, transforms each file by the specified program.
Expand Down Expand Up @@ -283,7 +283,10 @@ impl GroupConfig {
self.rf_over() + 1,
));
}
if self.isolate && self.paths.len() < self.rf_under() {
if self.isolate
&& (self.rf_under.is_some() || self.unique)
&& self.paths.len() < self.rf_under()
{
return Err(format!(
"The --isolate flag requires that the number of input paths ({}) \
is larger than the replication factor upper bound ({}). \
Expand Down

0 comments on commit 68fc34f

Please sign in to comment.