Sort search results when using -X option

This commit is contained in:
MarcoIeni 2020-01-02 16:45:49 +01:00 committed by David Peter
parent f7d1938556
commit 320d7fca0a
1 changed files with 4 additions and 2 deletions

View File

@ -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;