Skip to content

Commit 0335cc3

Browse files
committed
Do not allow list-details in combination with -1
1 parent a06efe1 commit 0335cc3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/app.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,12 @@ pub fn build_app() -> App<'static, 'static> {
441441
.long("max-results")
442442
.takes_value(true)
443443
.value_name("count")
444-
.conflicts_with_all(&["exec", "exec-batch"])
444+
// We currently do not support --max-results in combination with
445+
// program execution because the results that come up in a --max-results
446+
// search are non-deterministic. Users might think that they can run the
447+
// same search with `--exec rm` attached and get a reliable removal of
448+
// the files they saw in the previous search.
449+
.conflicts_with_all(&["exec", "exec-batch", "list-details"])
445450
.hidden_short_help(true)
446451
.long_help("Limit the number of search results to 'count' and quit immediately."),
447452
)
@@ -450,7 +455,7 @@ pub fn build_app() -> App<'static, 'static> {
450455
.short("1")
451456
.hidden_short_help(true)
452457
.overrides_with("max-results")
453-
.conflicts_with_all(&["exec", "exec-batch"])
458+
.conflicts_with_all(&["exec", "exec-batch", "list-details"])
454459
.long_help("Limit the search to a single result and quit immediately. \
455460
This is an alias for '--max-results=1'.")
456461
)

src/filesystem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::ffi::OsStr;
44
use std::fs;
55
use std::io;
66
#[cfg(any(unix, target_os = "redox"))]
7-
use std::os::unix::fs::{PermissionsExt, FileTypeExt};
7+
use std::os::unix::fs::{FileTypeExt, PermissionsExt};
88
use std::path::{Path, PathBuf};
99

1010
use crate::walk;

0 commit comments

Comments
 (0)