diff options
author | Rory Dudley | 2024-04-11 21:49:51 -0600 |
---|---|---|
committer | Rory Dudley | 2024-04-11 21:49:51 -0600 |
commit | 87e4a3da43e7d203d3405f977ce8e93298dd55c3 (patch) | |
tree | 111eb60af072f036bd7f7ba4e116a5a57f053b41 /src/poem/anthology/export.rs | |
parent | 6198c54a9e1155bb9b7f93b8cb5daf3e2deddb25 (diff) | |
download | dwarvish-87e4a3da43e7d203d3405f977ce8e93298dd55c3.tar.gz |
Sort output of 'export' and 'alias'
Sort the output of the built-in 'export' and 'alias' commands, in cases
where all environment variables/aliases are printed out.
Diffstat (limited to 'src/poem/anthology/export.rs')
-rw-r--r-- | src/poem/anthology/export.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/poem/anthology/export.rs b/src/poem/anthology/export.rs index dfbaf81..aa5a894 100644 --- a/src/poem/anthology/export.rs +++ b/src/poem/anthology/export.rs @@ -1,4 +1,5 @@ use crate::poem::Verse; +use std::collections::BTreeMap; use std::env; /// export @@ -26,7 +27,8 @@ pub fn incant(verse: &Verse) -> i32 { } } None => { - for (key, val) in env::vars() { + let sorted: BTreeMap<_, _> = env::vars().into_iter().collect(); + for (key, val) in sorted { println!("{}={}", key, val); } } |