Sort properties when steamosctl -a is used.

To make the output easier to parse as users sort by key.
This commit is contained in:
Jeremy Whiting 2024-04-29 22:44:56 -06:00
parent 8788e99245
commit 6e8e36b053
3 changed files with 20 additions and 1 deletions

View file

@ -7,6 +7,7 @@
use anyhow::Result;
use clap::{Parser, Subcommand};
use itertools::Itertools;
use std::ops::Deref;
use std::str::FromStr;
use steamos_manager::{ManagerProxy, WifiBackend};
@ -63,7 +64,8 @@ async fn main() -> Result<()> {
let properties = properties_proxy
.get_all(zvariant::Optional::from(Some(name)))
.await?;
for (key, value) in properties.iter() {
for key in properties.keys().sorted() {
let value = &properties[key];
let val = value.deref();
println!("{key}: {val}");
}