Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort search results when using -X option #524

Merged
merged 1 commit into from
Jan 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/exec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,15 @@ impl CommandTemplate {
cmd.stdout(Stdio::inherit());
cmd.stderr(Stdio::inherit());

let mut paths = paths.map(|p| Self::prepare_path(&p));
let mut paths: Vec<String> = paths.map(|p| Self::prepare_path(&p)).collect();
let mut has_path = false;

for arg in &self.args[1..] {
if arg.has_tokens() {
paths.sort();

// A single `Tokens` is expected
// So we can directy consume the iterator once and for all
// So we can directly consume the iterator once and for all
for path in &mut paths {
cmd.arg(arg.generate(&path).as_ref());
has_path = true;
Expand Down