diff --git a/Cargo.lock b/Cargo.lock index b413f27..211676f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -338,6 +338,12 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + [[package]] name = "endi" version = "1.1.0" @@ -563,6 +569,15 @@ dependencies = [ "libc", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -921,6 +936,7 @@ dependencies = [ "anyhow", "clap", "inotify", + "itertools", "libc", "nix", "tempfile", diff --git a/Cargo.toml b/Cargo.toml index 55be959..2f82b8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ anyhow = "1" clap = { version = "4.5", default-features = false, features = ["derive", "help", "std", "usage"] } inotify = { version = "0.10", default-features = false, features = ["stream"] } libc = "0.2" +itertools = "0.12" nix = { version = "0.28", default-features = false, features = ["fs", "signal"] } tokio = { version = "1", default-features = false, features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "signal", "sync"] } tokio-stream = { version = "0.1", default-features = false } diff --git a/src/bin/steamosctl.rs b/src/bin/steamosctl.rs index fc4983a..4217952 100644 --- a/src/bin/steamosctl.rs +++ b/src/bin/steamosctl.rs @@ -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}"); }