Skip to content

Commit

Permalink
feat(stats): add more entries to default command output
Browse files Browse the repository at this point in the history
  • Loading branch information
fosskers committed Jun 4, 2024
1 parent efca741 commit 032aa32
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 8 deletions.
47 changes: 40 additions & 7 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/aura-pm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ unic-langid = { version = "0.9", features = ["macros"] }
validated = { version = "0.4", features = ["rayon"] }
webbrowser = "1.0"
which = "6.0"
whoami = "1.5"

[features]
git = ["alpm/git"]
Expand Down
4 changes: 4 additions & 0 deletions rust/aura-pm/i18n/en-US/aura_pm.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ open-err = Failed to open { $url }.
# System Statistics (stats)
stats-local = Failed to load language data.
stats-host = Host
stats-user = User
stats-distro = Distribution
stats-editor = Editor
stats-pkgs = Installed packages
stats-aura-cache = Aura Package Cache
stats-pacman-cache = Pacman Package Cache
Expand Down
9 changes: 9 additions & 0 deletions rust/aura-pm/src/command/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ pub(crate) fn stats(env: &Env, fll: &FluentLanguageLoader) -> Result<(), Error>
let aura_build_bytes = aura_core::recursive_dir_size(&env.aur.build);

let pairs = vec![
(
fl!(fll, "stats-host"),
whoami::fallible::hostname()
.unwrap_or_else(|_| "Unknown".to_string())
.normal(),
),
(fl!(fll, "stats-user"), whoami::username().normal()),
(fl!(fll, "stats-distro"), whoami::distro().normal()),
(fl!(fll, "stats-editor"), env.general.editor.normal()),
(fl!(fll, "stats-pkgs"), pkgs.to_string().normal()),
(
fl!(fll, "stats-pacman-cache"),
Expand Down
1 change: 0 additions & 1 deletion rust/aura-pm/src/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,6 @@ pub struct Cache {
pub search: Option<String>,

// TODO Make other options elsewhere that expect a path have `PathBuf` too.
// TODO Restore the `short` flag for this option after resolving the conflict with `--dbpath`!
/// Back up the package cache to a given directory.
#[clap(group = "cache", long, short, value_name = "target", display_order = 1)]
pub backup: Option<PathBuf>,
Expand Down

0 comments on commit 032aa32

Please sign in to comment.