From d255d4a4ff394da96bb669fef7a70871e08498fa Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Tue, 31 Dec 2013 23:47:15 +1100 Subject: [PATCH] std: print RUST_LOG=::help in sorted order. Fixes #8949. --- src/libstd/rt/logging.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libstd/rt/logging.rs b/src/libstd/rt/logging.rs index 3f169b511df..dfcf49734df 100644 --- a/src/libstd/rt/logging.rs +++ b/src/libstd/rt/logging.rs @@ -17,7 +17,7 @@ use io::stdio::StdWriter; use io::buffered::LineBufferedWriter; use rt::crate_map::{ModEntry, CrateMap, iter_crate_map, get_crate_map}; use str::StrSlice; -use vec::ImmutableVector; +use vec::{ImmutableVector, MutableTotalOrdVector}; #[cfg(test)] use cast::transmute; struct LogDirective { @@ -141,7 +141,14 @@ fn update_log_settings(crate_map: &CrateMap, settings: ~str) { if settings.len() > 0 { if settings == ~"::help" || settings == ~"?" { rterrln!("\nCrate log map:\n"); - iter_crate_map(crate_map, |entry| rterrln!(" {}", entry.name)); + + let mut entries = ~[]; + iter_crate_map(crate_map, |entry| entries.push(entry.name.to_owned())); + entries.sort(); + + for name in entries.iter() { + rterrln!(" {}", *name); + } unsafe { exit(1); } } dirs = parse_logging_spec(settings);