diff --git a/bin/core/imag/src/main.rs b/bin/core/imag/src/main.rs index b569b46d..0f74458d 100644 --- a/bin/core/imag/src/main.rs +++ b/bin/core/imag/src/main.rs @@ -86,10 +86,10 @@ fn help_text(cmds: Vec) -> String { /// Returns the list of imag-* executables found in $PATH fn get_commands() -> Vec { - match env::var("PATH") { + let mut v = match env::var("PATH") { Err(e) => { println!("PATH error: {:?}", e); - exit(1); + exit(1) }, Ok(path) => path @@ -109,8 +109,11 @@ fn get_commands() -> Vec { .and_then(|s| s.splitn(2, "-").nth(1).map(String::from)) ) }) - .collect() - } + .collect::>() + }; + + v.sort(); + v }