Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre committed Aug 1, 2024
2 parents e412c1f + d30daba commit a249bc5
Show file tree
Hide file tree
Showing 12 changed files with 266 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
env:
CARGO_INCREMENTAL: "0"
RUSTC_WRAPPER: ""
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
RUSTDOCFLAGS: "-Cpanic=abort"
- name: "`grcov` ~ install"
id: build_grcov
Expand Down
145 changes: 103 additions & 42 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ uudoc = []
feat_common_core = [
"mountpoint",
"lscpu",
"lsmem",
"ctrlaltdel",
"rev",
"last"
Expand All @@ -39,7 +40,7 @@ clap = { version = "4.4", features = ["wrap_help", "cargo"] }
clap_complete = "4.4"
clap_mangen = "0.2"
regex = "1.10.2"
sysinfo = "0.30"
sysinfo = "0.31"
libc = "0.2.152"
phf = "0.11.2"
phf_codegen = "0.11.2"
Expand All @@ -60,6 +61,7 @@ dns-lookup = { workspace = true }

#
lscpu = { optional = true, version = "0.0.1", package = "uu_lscpu", path = "src/uu/lscpu" }
lsmem = { optional = true, version = "0.0.1", package = "uu_lsmem", path = "src/uu/lsmem" }
mountpoint = { optional = true, version = "0.0.1", package = "uu_mountpoint", path = "src/uu/mountpoint" }
ctrlaltdel = { optional = true, version = "0.0.1", package = "uu_ctrlaltdel", path = "src/uu/ctrlaltdel" }
rev = { optional = true, version = "0.0.1", package = "uu_rev", path = "src/uu/rev" }
Expand Down
2 changes: 1 addition & 1 deletion src/uu/lscpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
path = "src/lscpu.rs"

[[bin]]
name = "mountpoint"
name = "lscpu"
path = "src/main.rs"

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion src/uu/lscpu/src/lscpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const USAGE: &str = help_usage!("lscpu.md");
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let _matches: clap::ArgMatches = uu_app().try_get_matches_from(args)?;
let system = System::new_all();
let _cpu = system.global_cpu_info();

println!("Architecture: {}", get_architecture());
println!("CPU(s): {}", system.cpus().len());
Expand Down
15 changes: 15 additions & 0 deletions src/uu/lsmem/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "uu_lsmem"
version = "0.0.1"
edition = "2021"

[lib]
path = "src/lsmem.rs"

[[bin]]
name = "lsmem"
path = "src/main.rs"

[dependencies]
uucore = { workspace = true }
clap = { workspace = true }
7 changes: 7 additions & 0 deletions src/uu/lsmem/lsmem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# lsmem

```
lsmem [OPTION]...
```

List the ranges of available memory with their online status.
24 changes: 24 additions & 0 deletions src/uu/lsmem/src/lsmem.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This file is part of the uutils util-linux package.
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use clap::{crate_version, Command};
use uucore::{error::UResult, format_usage, help_about, help_usage};

const ABOUT: &str = help_about!("lsmem.md");
const USAGE: &str = help_usage!("lsmem.md");

#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let _matches: clap::ArgMatches = uu_app().try_get_matches_from(args)?;
Ok(())
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(crate_version!())
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
}
1 change: 1 addition & 0 deletions src/uu/lsmem/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uucore::bin!(uu_lsmem);
Loading

0 comments on commit a249bc5

Please sign in to comment.