Skip to content

Commit

Permalink
Do not allow list-details in combination with -1
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Apr 16, 2020
1 parent a06efe1 commit 0335cc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
)
Expand All @@ -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'.")
)
Expand Down
2 changes: 1 addition & 1 deletion src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0335cc3

Please sign in to comment.