Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ uudoc = []

feat_common_core = [
"free",
"hugetop",
"pgrep",
"pidof",
"pidwait",
Expand Down Expand Up @@ -84,6 +85,7 @@ uucore = { workspace = true }

#
free = { optional = true, version = "0.0.1", package = "uu_free", path = "src/uu/free" }
hugetop = { optional = true, version = "0.0.1", package = "uu_hugetop", path = "src/uu/hugetop" }
pgrep = { optional = true, version = "0.0.1", package = "uu_pgrep", path = "src/uu/pgrep" }
pidof = { optional = true, version = "0.0.1", package = "uu_pidof", path = "src/uu/pidof" }
pidwait = { optional = true, version = "0.0.1", package = "uu_pidwait", path = "src/uu/pidwait" }
Expand Down
35 changes: 35 additions & 0 deletions src/uu/hugetop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "uu_hugetop"
version = "0.0.1"
edition = "2021"
authors = ["uutils developers"]
license = "MIT"
description = "hugetop ~ (uutils) report huge page information"

homepage = "https://github.com/uutils/procps"
repository = "https://github.com/uutils/procps/tree/main/src/uu/hugetop"
keywords = ["acl", "uutils", "cross-platform", "cli", "utility"]
categories = ["command-line-utilities"]

[dependencies]
uucore = { workspace = true, features = ["utmpx", "uptime"] }
clap = { workspace = true }
libc = { workspace = true }
nix = { workspace = true }
prettytable-rs = { workspace = true }
sysinfo = { workspace = true }
chrono = { workspace = true }
bytesize = { workspace = true }

# TODO: @hz2 finish adjusting
# for integration test of `--once`, mocking /proc etc.
[dev-dependencies]
assert_cmd = { workspace = true }
predicates = { workspace = true }

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

[[bin]]
name = "hugetop"
path = "src/main.rs"
7 changes: 7 additions & 0 deletions src/uu/hugetop/hugetop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# hugetop

```
hugetop [options]
```

report huge page information
28 changes: 28 additions & 0 deletions src/uu/hugetop/src/hugetop.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// src/hugetop.rs

use clap::{arg, crate_version, value_parser, ArgAction, Command};
use std::{
fs,
io::{BufRead, BufReader},
thread::sleep,
time::Duration,
};
use uucore::{error::UResult, format_usage, help_about, help_usage};

use bytesize::ByteSize;
use chrono::Local;

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

pub struct Settings {
delay: Option<u64>,
human: bool,
once: bool,
numa: bool,
}

#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
todo!();
}
1 change: 1 addition & 0 deletions src/uu/hugetop/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uucore::bin!(uu_hugetop);
Loading