summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-04-16 10:11:05 +0200
committersharkdp <davidpeter@web.de>2020-04-16 10:11:05 +0200
commit0335cc362b2c830c24b957504a7cb1f7cd623a44 (patch)
tree49a24dc89d3d2a441fe8ab39e6faf94696e66646
parenta06efe141824ee1a1cf74e9b78169691168371cf (diff)
Do not allow list-details in combination with -1v8.0.0
-rw-r--r--src/app.rs9
-rw-r--r--src/filesystem.rs2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/app.rs b/src/app.rs
index 5704bb6..8c23e23 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -441,7 +441,12 @@ pub fn build_app() -> App<'static, 'static> {
.long("max-results")
.takes_value(true)
.value_name("count")
- .conflicts_with_all(&["exec", "exec-batch"])
+ // We currently do not support --max-results in combination with
+ // program execution because the results that come up in a --max-results
+ // search are non-deterministic. Users might think that they can run the
+ // same search with `--exec rm` attached and get a reliable removal of
+ // the files they saw in the previous search.
+ .conflicts_with_all(&["exec", "exec-batch", "list-details"])
.hidden_short_help(true)
.long_help("Limit the number of search results to 'count' and quit immediately."),
)
@@ -450,7 +455,7 @@ pub fn build_app() -> App<'static, 'static> {
.short("1")
.hidden_short_help(true)
.overrides_with("max-results")
- .conflicts_with_all(&["exec", "exec-batch"])
+ .conflicts_with_all(&["exec", "exec-batch", "list-details"])
.long_help("Limit the search to a single result and quit immediately. \
This is an alias for '--max-results=1'.")
)
diff --git a/src/filesystem.rs b/src/filesystem.rs
index a41fd58..a14f74d 100644
--- a/src/filesystem.rs
+++ b/src/filesystem.rs
@@ -4,7 +4,7 @@ use std::ffi::OsStr;
use std::fs;
use std::io;
#[cfg(any(unix, target_os = "redox"))]
-use std::os::unix::fs::{PermissionsExt, FileTypeExt};
+use std::os::unix::fs::{FileTypeExt, PermissionsExt};
use std::path::{Path, PathBuf};
use crate::walk;