-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94c8f17
commit 0944f2f
Showing
6 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "uu_slabtop" | ||
version = "0.0.1" | ||
edition = "2021" | ||
authors = ["uutils developers"] | ||
license = "MIT" | ||
description = "slabtop ~ (uutils) Display kernel slab cache information in real time" | ||
|
||
homepage = "https://github.com/uutils/procps" | ||
repository = "https://github.com/uutils/procps/tree/main/src/uu/slabtop" | ||
keywords = ["acl", "uutils", "cross-platform", "cli", "utility"] | ||
categories = ["command-line-utilities"] | ||
|
||
|
||
[dependencies] | ||
uucore = { workspace = true } | ||
clap = { workspace = true } | ||
bytesize = { workspace = true } | ||
|
||
sysinfo = { workspace = true } | ||
|
||
[lib] | ||
path = "src/slabtop.rs" | ||
|
||
[[bin]] | ||
name = "slabtop" | ||
path = "src/main.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# slabtop | ||
|
||
``` | ||
slabtop [options] | ||
``` | ||
|
||
Display kernel slab cache information in real time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uucore::bin!(uu_slabtop); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// This file is part of the uutils procps package. | ||
// | ||
// For the full copyright and license information, please view the LICENSE | ||
// file that was distributed with this source code. | ||
|
||
use clap::{arg, crate_version, ArgAction, Command}; | ||
use uucore::{error::UResult, format_usage, help_about, help_usage}; | ||
|
||
const ABOUT: &str = help_about!("slabtop.md"); | ||
const USAGE: &str = help_usage!("slabtop.md"); | ||
|
||
#[uucore::main] | ||
pub fn uumain(args: impl uucore::Args) -> UResult<()> { | ||
let _matches = 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) | ||
.disable_help_flag(true) | ||
.args([ | ||
arg!(-d --delay <secs> "delay updates"), | ||
arg!(-o --once "only display once, then exit"), | ||
arg!(-s --sort <char> "specify sort criteria by character (see below)"), | ||
arg!(-h --help "display this help and exit").action(ArgAction::Help), | ||
]) | ||
} |