Merge pull request #71 from howjmay/lsmem

lsmem: Add lsmem
This commit is contained in:
Daniel Hofstetter
2024-07-26 18:33:28 +02:00
committed by GitHub
7 changed files with 62 additions and 0 deletions

9
Cargo.lock generated
View File

@@ -643,6 +643,7 @@ dependencies = [
"textwrap", "textwrap",
"uu_ctrlaltdel", "uu_ctrlaltdel",
"uu_lscpu", "uu_lscpu",
"uu_lsmem",
"uu_mountpoint", "uu_mountpoint",
"uu_rev", "uu_rev",
"uucore", "uucore",
@@ -667,6 +668,14 @@ dependencies = [
"uucore", "uucore",
] ]
[[package]]
name = "uu_lsmem"
version = "0.0.1"
dependencies = [
"clap",
"uucore",
]
[[package]] [[package]]
name = "uu_mountpoint" name = "uu_mountpoint"
version = "0.0.1" version = "0.0.1"

View File

@@ -28,6 +28,7 @@ uudoc = []
feat_common_core = [ feat_common_core = [
"mountpoint", "mountpoint",
"lscpu", "lscpu",
"lsmem",
"ctrlaltdel", "ctrlaltdel",
"rev", "rev",
] ]
@@ -58,6 +59,7 @@ textwrap = { workspace = true }
# #
lscpu = { optional = true, version = "0.0.1", package = "uu_lscpu", path = "src/uu/lscpu" } 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" } 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" } 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" } rev = { optional = true, version = "0.0.1", package = "uu_rev", path = "src/uu/rev" }

15
src/uu/lsmem/Cargo.toml Normal file
View File

@@ -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
src/uu/lsmem/lsmem.md Normal file
View File

@@ -0,0 +1,7 @@
# lsmem
```
lsmem [OPTION]...
```
List the ranges of available memory with their online status.

24
src/uu/lsmem/src/lsmem.rs Normal file
View File

@@ -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
src/uu/lsmem/src/main.rs Normal file
View File

@@ -0,0 +1 @@
uucore::bin!(uu_lsmem);

View File

@@ -0,0 +1,4 @@
// 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.