mirror of
https://github.com/danog/ytop.git
synced 2024-11-26 20:15:03 +01:00
refactor: reorder args.rs
This commit is contained in:
parent
d3cd9a5e2e
commit
1c23334444
38
src/args.rs
38
src/args.rs
@ -28,6 +28,14 @@ impl FromStr for Colorscheme {
|
|||||||
|
|
||||||
#[derive(StructOpt)]
|
#[derive(StructOpt)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
|
/// Show average CPU in the CPU widget.
|
||||||
|
#[structopt(short = "a", long = "average-cpu")]
|
||||||
|
pub average_cpu: bool,
|
||||||
|
|
||||||
|
/// Show Battery widget (overridden by 'minimal' flag).
|
||||||
|
#[structopt(short = "b", long = "battery")]
|
||||||
|
pub battery: bool,
|
||||||
|
|
||||||
/// Set a colorscheme.
|
/// Set a colorscheme.
|
||||||
#[structopt(
|
#[structopt(
|
||||||
short = "c",
|
short = "c",
|
||||||
@ -43,35 +51,27 @@ pub struct Args {
|
|||||||
)]
|
)]
|
||||||
pub colorscheme: Colorscheme,
|
pub colorscheme: Colorscheme,
|
||||||
|
|
||||||
|
/// Show temperatures in fahrenheit.
|
||||||
|
#[structopt(short = "f", long = "fahrenheit")]
|
||||||
|
pub fahrenheit: bool,
|
||||||
|
|
||||||
|
/// Comma separated list of network interfaces to show. Prepend an interface with '!' to hide it. 'all' shows all interfaces.
|
||||||
|
#[structopt(short = "i", long = "interfaces", default_value = "!tun0")]
|
||||||
|
pub interfaces: String,
|
||||||
|
|
||||||
/// Only show the CPU, Mem, and Process widgets.
|
/// Only show the CPU, Mem, and Process widgets.
|
||||||
#[structopt(short = "m", long = "minimal")]
|
#[structopt(short = "m", long = "minimal")]
|
||||||
pub minimal: bool,
|
pub minimal: bool,
|
||||||
|
|
||||||
/// Number of times per second to update the CPU and Mem widgets.
|
|
||||||
#[structopt(short = "r", long = "rate", default_value = "1")]
|
|
||||||
pub rate: f64,
|
|
||||||
|
|
||||||
/// Show each CPU in the CPU widget.
|
/// Show each CPU in the CPU widget.
|
||||||
#[structopt(short = "p", long = "per-cpu")]
|
#[structopt(short = "p", long = "per-cpu")]
|
||||||
pub per_cpu: bool,
|
pub per_cpu: bool,
|
||||||
|
|
||||||
/// Show average CPU in the CPU widget.
|
/// Number of times per second to update the CPU and Mem widgets.
|
||||||
#[structopt(short = "a", long = "average-cpu")]
|
#[structopt(short = "r", long = "rate", default_value = "1")]
|
||||||
pub average_cpu: bool,
|
pub rate: f64,
|
||||||
|
|
||||||
/// Show temperatures in fahrenheit.
|
|
||||||
#[structopt(short = "f", long = "fahrenheit")]
|
|
||||||
pub fahrenheit: bool,
|
|
||||||
|
|
||||||
/// Show a statusbar with the time.
|
/// Show a statusbar with the time.
|
||||||
#[structopt(short = "s", long = "statusbar")]
|
#[structopt(short = "s", long = "statusbar")]
|
||||||
pub statusbar: bool,
|
pub statusbar: bool,
|
||||||
|
|
||||||
/// Show Battery widget (overridden by 'minimal' flag).
|
|
||||||
#[structopt(short = "b", long = "battery")]
|
|
||||||
pub battery: bool,
|
|
||||||
|
|
||||||
/// Comma separated list of network interfaces to show. Prepend an interface with '!' to hide it. 'all' shows all interfaces.
|
|
||||||
#[structopt(short = "i", long = "interfaces", default_value = "!tun0")]
|
|
||||||
pub interfaces: String,
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user