summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2024-04-11 00:46:35 +0000
committerGitHub <noreply@github.com>2024-04-10 20:46:35 -0400
commit93d67187664fc43814955fbf94511bbfb2cf6eca (patch)
tree7a1a38d228025ef50b2770cd65866074725c2e0b
parentbb0bc8a0b0efb92d6e99ec46ca08d7b2d9652e57 (diff)
other: update a bunch of argument descriptions and some arg/config names (#1441)
* other: update a bunch of argument descriptions and some arg/config names * update docs * changelog
-rw-r--r--CHANGELOG.md5
-rw-r--r--docs/content/configuration/command-line-options.md118
-rw-r--r--docs/content/configuration/config-file/flags.md4
-rw-r--r--sample_configs/default_config.toml4
-rw-r--r--sample_configs/demo_config.toml2
-rw-r--r--schema/nightly/bottom.json4
-rw-r--r--src/app.rs6
-rw-r--r--src/canvas/widgets/cpu_graph.rs4
-rw-r--r--src/constants.rs4
-rw-r--r--src/options.rs10
-rw-r--r--src/options/args.rs490
-rw-r--r--src/options/args.template8
-rw-r--r--src/options/config.rs4
-rw-r--r--src/options/config/layout.rs23
14 files changed, 327 insertions, 359 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62f09a1a..9c60d394 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1376](https://github.com/ClementTsang/bottom/pull/1376): Group together related command-line arguments in `-h` and `--help`.
- [#1411](https://github.com/ClementTsang/bottom/pull/1411): Add `time` as a default column.
- [#1436](https://github.com/ClementTsang/bottom/pull/1436): Use actual "swap" value for Windows.
+- [#1441](https://github.com/ClementTsang/bottom/pull/1441): The following arguments have changed names:
+ - `--left_legend/-l` is now `--cpu_left_legend`.
+- [#1441](https://github.com/ClementTsang/bottom/pull/1441): The following config arguments have changed names:
+ - `expanded_on_startup` is now `expanded`.
+ - `left_legend` is now `cpu_left_legend`.
### Bug Fixes
diff --git a/docs/content/configuration/command-line-options.md b/docs/content/configuration/command-line-options.md
index e0c6286b..9d95fc96 100644
--- a/docs/content/configuration/command-line-options.md
+++ b/docs/content/configuration/command-line-options.md
@@ -5,76 +5,76 @@ see information on these options by running `btm -h`, or run `btm --help` to dis
## General Options
-| Option | Behaviour |
-| ------------------------------------- | --------------------------------------------------- |
-| `--autohide_time` | Temporarily shows the time scale in graphs. |
-| `-b`, `--basic` | Hides graphs and uses a more basic look. |
-| `-C`, `--config <CONFIG PATH>` | Sets the location of the config file. |
-| `-t`, `--default_time_value <TIME>` | Default time value for graphs. |
-| `--default_widget_count <INT>` | Sets the n'th selected widget type as the default. |
-| `--default_widget_type <WIDGET TYPE>` | Sets the default widget type, use --help for info. |
-| `--disable_click` | Disables mouse clicks. |
-| `-m`, `--dot_marker` | Uses a dot marker for graphs. |
-| `-e`, `--expanded` | Expand the default widget upon starting the app. |
-| `--hide_table_gap` | Hides spacing between table headers and entries. |
-| `--hide_time` | Hides the time scale. |
-| `-l`, `--left_legend` | Puts the CPU chart legend to the left side. |
-| `-r`, `--rate <TIME>` | Sets the data refresh rate. |
-| `--retention <TIME>` | The timespan of data stored. |
-| `--show_table_scroll_position` | Shows the scroll position tracker in table widgets. |
-| `-d`, `--time_delta <TIME>` | The amount of time changed upon zooming. |
+| Option | Behaviour |
+| --------------------------------- | ---------------------------------------------------- |
+| `--autohide_time` | Temporarily shows the time scale in graphs. |
+| `-b, --basic` | Hides graphs and uses a more basic look. |
+| `-C, --config <CONFIG PATH>` | Sets the location of the config file. |
+| `-t, --default_time_value <TIME>` | Default time value for graphs. |
+| `--default_widget_count <N>` | Sets the N'th selected widget type as the default. |
+| `--default_widget_type <WIDGET>` | Sets the default widget type, use `--help` for info. |
+| `--disable_click` | Disables mouse clicks. |
+| `-m, --dot_marker` | Uses a dot marker for graphs. |
+| `-e, --expanded` | Expand the default widget upon starting the app. |
+| `--hide_table_gap` | Hides spacing between table headers and entries. |
+| `--hide_time` | Hides the time scale from being shown. |
+| `-r, --rate <TIME>` | Sets how often data is refreshed. |
+| `--retention <TIME>` | How far back data will be stored up to. |
+| `--show_table_scroll_position` | Shows the scroll position tracker in table widgets. |
+| `-d, --time_delta <TIME>` | The amount of time changed upon zooming. |
## Process Options
-| Option | Behaviour |
-| -------------------------- | --------------------------------------------------------------------- |
-| `-S`, `--case_sensitive` | Enables case sensitivity by default. |
-| `-u`, `--current_usage` | Sets process CPU% to be based on current CPU%. |
-| `--disable_advanced_kill` | Hides advanced process killing. |
-| `-g`, `--group_processes` | Groups processes with the same name by default. |
-| `--process_command` | Show processes as their commands by default. |
-| `-R`, `--regex` | Enables regex by default. |
-| `-T`, `--tree` | Defaults the process widget be in tree mode. |
-| `-n`, `--unnormalized_cpu` | Show process CPU% usage without normalizing over the number of cores. |
-| `-W`, `--whole_word` | Enables whole-word matching by default. |
+| Option | Behaviour |
+| ------------------------- | -------------------------------------------------------------------------------------- |
+| `-S, --case_sensitive` | Enables case sensitivity by default. |
+| `-u, --current_usage` | Calculates process CPU usage as a percentage of current usage rather than total usage. |
+| `--disable_advanced_kill` | Hides additional stopping options Unix-like systems. |
+| `-g, --group_processes` | Groups processes with the same name by default. |
+| `--mem_as_value` | Defaults to showing process memory usage by value. |
+| `--process_command` | Shows the full command name instead of the process name by default. |
+| `-R, --regex` | Enables regex by default while searching. |
+| `-T, --tree` | Makes the process widget use tree mode by default. |
+| `-n, --unnormalized_cpu` | Show process CPU% usage without averaging over the number of CPU cores. |
+| `-W, --whole_word` | Enables whole-word matching by default while searching. |
## Temperature Options
-| Option | Behaviour |
-| -------------------- | --------------------------------------- |
-| `-c`, `--celsius` | Use Celsius as the temperature unit. |
-| `-f`, `--fahrenheit` | Use Fahrenheit as the temperature unit. |
-| `-k`, `--kelvin` | Use Kelvin as the temperature unit. |
+| Option | Behaviour |
+| ------------------ | --------------------------------------------- |
+| `-c, --celsius` | Use Celsius as the temperature unit. Default. |
+| `-f, --fahrenheit` | Use Fahrenheit as the temperature unit. |
+| `-k, --kelvin` | Use Kelvin as the temperature unit. |
## CPU Options
-| Option | Behaviour |
-| ---------------------- | ---------------------------- |
-| `-a`, `--hide_avg_cpu` | Hides the average CPU usage. |
+| Option | Behaviour |
+| -------------------- | ------------------------------------------- |
+| `--cpu_left_legend` | Puts the CPU chart legend on the left side. |
+| `-a, --hide_avg_cpu` | Hides the average CPU usage entry. |
## Memory Options
-| Option | Behaviour |
-| ----------------------- | --------------------------------------------------------- |
-| `--enable_cache_memory` | Enable collecting and displaying cache and buffer memory. |
-| `--mem_as_value` | Defaults to showing process memory usage by value. |
-| `--memory_legend` | Where to place the legend for the memory widget. |
+| Option | Behaviour |
+| ---------------------------- | --------------------------------------------------------- |
+| `--enable_cache_memory` | Enable collecting and displaying cache and buffer memory. |
+| `--memory_legend <POSITION>` | Where to place the legend for the memory chart widget. |
## Network Options
-| Option | Behaviour |
-| ----------------------------- | ------------------------------------------------- |
-| `--network_use_binary_prefix` | Displays the network widget with binary prefixes. |
-| `--network_use_bytes` | Displays the network widget using bytes. |
-| `--network_use_log` | Displays the network widget with a log scale. |
-| `--network_legend` | Where to place the legend for the network widget. |
-| `--use_old_network_legend` | DEPRECATED - uses a separate network legend. |
+| Option | Behaviour |
+| ----------------------------- | ------------------------------------------------------- |
+| `--network_legend <POSITION>` | Where to place the legend for the network chart widget. |
+| `--network_use_binary_prefix` | Displays the network widget with binary prefixes. |
+| `--network_use_bytes` | Displays the network widget using bytes. |
+| `--network_use_log` | Displays the network widget with a log scale. |
+| `--use_old_network_legend` | (DEPRECATED) Uses a separated network legend. |
## Battery Options
-| Option | Behaviour |
-| ----------- | ------------------------- |
-| `--battery` | Shows the battery widget. |
+| Option | Behaviour |
+| ----------- | ----------------------------------------------- |
+| `--battery` | Shows the battery widget in non-custom layouts. |
## GPU Options
@@ -84,13 +84,13 @@ see information on these options by running `btm -h`, or run `btm --help` to dis
## Style Options
-| Option | Behaviour |
-| ------------------------ | ---------------------------------------- |
-| `--color <COLOR SCHEME>` | Use a color scheme, use --help for info. |
+| Option | Behaviour |
+| ------------------------ | ------------------------------------------ |
+| `--color <COLOR SCHEME>` | Use a color scheme, use `--help` for info. |
## Other Options
-| Option | Behaviour |
-| ----------------- | ------------------------------------------ |
-| `-h`, `--help` | Prints help (see more info with '--help'). |
-| `-V`, `--version` | Prints version information. |
+| Option | Behaviour |
+| ----------------- | ------------------------------------------------- |
+| `-h`, `--help` | Prints help info (for more details use `--help`.) |
+| `-V`, `--version` | Prints version information. |
diff --git a/docs/content/configuration/config-file/flags.md b/docs/content/configuration/config-file/flags.md
index f8bacfbb..90a8d59f 100644
--- a/docs/content/configuration/config-file/flags.md
+++ b/docs/content/configuration/config-file/flags.md
@@ -11,7 +11,7 @@ each time:
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
| `hide_avg_cpu` | Boolean | Hides the average CPU usage. |
| `dot_marker` | Boolean | Uses a dot marker for graphs. |
-| `left_legend` | Boolean | Puts the CPU chart legend to the left side. |
+| `cpu_left_legend` | Boolean | Puts the CPU chart legend to the left side. |
| `current_usage` | Boolean | Sets process CPU% to be based on current CPU%. |
| `group_processes` | Boolean | Groups processes with the same name by default. |
| `case_sensitive` | Boolean | Enables case sensitivity by default. |
@@ -41,6 +41,6 @@ each time:
| `enable_gpu` | Boolean | Shows the GPU widgets. |
| `retention` | String (human readable time, such as "10m", "1h", etc.) | How much data is stored at once in terms of time. |
| `unnormalized_cpu` | Boolean | Show process CPU% without normalizing over the number of cores. |
-| `expanded_on_startup` | Boolean | Expand the default widget upon starting the app. |
+| `expanded` | Boolean | Expand the default widget upon starting the app. |
| `memory_legend` | String (one of ["none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right"]) | Where to place the legend for the memory widget. |
| `network_legend` | String (one of ["none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right"]) | Where to place the legend for the network widget. |
diff --git a/sample_configs/default_config.toml b/sample_configs/default_config.toml
index 8524ea43..3c20e4f4 100644
--- a/sample_configs/default_config.toml
+++ b/sample_configs/default_config.toml
@@ -14,7 +14,7 @@
# The update rate of the application.
#rate = "1s"
# Whether to put the CPU legend to the left.
-#left_legend = false
+#cpu_left_legend = false
# Whether to set CPU% on a process to be based on the total CPU or just current usage.
#current_usage = false
# Whether to set CPU% on a process to be based on the total CPU or per-core CPU% (not divided by the number of cpus).
@@ -44,7 +44,7 @@
#default_widget_type = "proc"
#default_widget_count = 1
# Expand selected widget upon starting the app
-#expanded_on_startup = true
+#expanded = true
# Use basic mode
#basic = false
# Use the old network legend style
diff --git a/sample_configs/demo_config.toml b/sample_configs/demo_config.toml
index e6c5cf71..32dd50cd 100644
--- a/sample_configs/demo_config.toml
+++ b/sample_configs/demo_config.toml
@@ -5,7 +5,7 @@ avg_cpu = true
temperature_type = "c"
rate = 1000
-left_legend = false
+cpu_left_legend = false
current_usage = false
group_processes = false
case_sensitive = false
diff --git a/schema/nightly/bottom.json b/schema/nightly/bottom.json
index 1f0aeac6..b1debe2f 100644
--- a/schema/nightly/bottom.json
+++ b/schema/nightly/bottom.json
@@ -75,7 +75,7 @@
"description": "The update rate of the application",
"type": "integer"
},
- "left_legend": {
+ "cpu_left_legend": {
"default": false,
"description": "Whether to put the CPU legend to the left",
"type": "boolean"
@@ -141,7 +141,7 @@
"description": "Override layout default widget",
"type": "integer"
},
- "expanded_on_startup": {
+ "expanded": {
"default": true,
"description": "Expand selected widget upon starting the app",
"type": "boolean"
diff --git a/src/app.rs b/src/app.rs
index 60ad35b8..11cd358b 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -47,7 +47,7 @@ pub struct AppConfigFields {
pub update_rate: u64,
pub temperature_type: temperature::TemperatureType,
pub use_dot: bool,
- pub left_legend: bool,
+ pub cpu_left_legend: bool,
pub show_average_cpu: bool, // TODO: Unify this in CPU options
pub use_current_cpu_total: bool,
pub unnormalized_cpu: bool,
@@ -1835,7 +1835,7 @@ impl App {
}
}
}
- } else if self.app_config_fields.left_legend {
+ } else if self.app_config_fields.cpu_left_legend {
if let BottomWidgetType::Cpu = self.current_widget.widget_type {
if let Some(current_widget) = self.widget_map.get(&self.current_widget.widget_id) {
if let Some(cpu_widget_state) = self
@@ -1872,7 +1872,7 @@ impl App {
self.current_widget = proc_sort_widget.clone();
}
}
- } else if self.app_config_fields.left_legend {
+ } else if self.app_config_fields.cpu_left_legend {
if let BottomWidgetType::CpuLegend = self.current_widget.widget_type {
if let Some(current_widget) = self.widget_map.get(&self.current_widget.widget_id) {
if let Some(new_widget_id) = current_widget.right_neighbour {
diff --git a/src/canvas/widgets/cpu_graph.rs b/src/canvas/widgets/cpu_graph.rs
index f882b210..85200e98 100644
--- a/src/canvas/widgets/cpu_graph.rs
+++ b/src/canvas/widgets/cpu_graph.rs
@@ -30,7 +30,7 @@ impl Painter {
if legend_width < 6 {
// Skip drawing legend
if app_state.current_widget.widget_id == (widget_id + 1) {
- if app_state.app_config_fields.left_legend {
+ if app_state.app_config_fields.cpu_left_legend {
app_state.move_widget_selection(&WidgetDirection::Right);
} else {
app_state.move_widget_selection(&WidgetDirection::Left);
@@ -54,7 +54,7 @@ impl Painter {
} else {
let graph_width = draw_loc.width - legend_width;
let (graph_index, legend_index, constraints) =
- if app_state.app_config_fields.left_legend {
+ if app_state.app_config_fields.cpu_left_legend {
(
1,
0,
diff --git a/src/constants.rs b/src/constants.rs
index 1c3aa097..50e66ab7 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -532,7 +532,7 @@ pub const CONFIG_TEXT: &str = r#"# This is a default config file for bottom. Al
# The update rate of the application.
#rate = "1s"
# Whether to put the CPU legend to the left.
-#left_legend = false
+#cpu_left_legend = false
# Whether to set CPU% on a process to be based on the total CPU or just current usage.
#current_usage = false
# Whether to set CPU% on a process to be based on the total CPU or per-core CPU% (not divided by the number of cpus).
@@ -562,7 +562,7 @@ pub const CONFIG_TEXT: &str = r#"# This is a default config file for bottom. Al
#default_widget_type = "proc"
#default_widget_count = 1
# Expand selected widget upon starting the app
-#expanded_on_startup = true
+#expanded = true
# Use basic mode
#basic = false
# Use the old network legend style
diff --git a/src/options.rs b/src/options.rs
index e36685ea..29b23178 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -74,7 +74,7 @@ pub fn init_app(
.context("Update 'default_time_value' in your config file.")?;
let use_basic_mode = is_flag_enabled!(basic, matches, config);
- let expanded_upon_startup = is_flag_enabled!(expanded_on_startup, matches, config);
+ let expanded = is_flag_enabled!(expanded, matches, config);
// For processes
let is_grouped = is_flag_enabled!(group_processes, matches, config);
@@ -137,7 +137,7 @@ pub fn init_app(
.context("Update 'temperature_type' in your config file.")?,
show_average_cpu: get_show_average_cpu(matches, config),
use_dot: is_flag_enabled!(dot_marker, matches, config),
- left_legend: is_flag_enabled!(left_legend, matches, config),
+ cpu_left_legend: is_flag_enabled!(cpu_left_legend, matches, config),
use_current_cpu_total: is_flag_enabled!(current_usage, matches, config),
unnormalized_cpu: is_flag_enabled!(unnormalized_cpu, matches, config),
use_basic_mode,
@@ -346,7 +346,7 @@ pub fn init_app(
temp_filter,
net_filter,
};
- let is_expanded = expanded_upon_startup && !use_basic_mode;
+ let is_expanded = expanded && !use_basic_mode;
Ok(App::new(
app_config_fields,
@@ -362,7 +362,7 @@ pub fn init_app(
pub fn get_widget_layout(
matches: &ArgMatches, config: &Config,
) -> error::Result<(BottomLayout, u64, Option<BottomWidgetType>)> {
- let left_legend = is_flag_enabled!(left_legend, matches, config);
+ let cpu_left_legend = is_flag_enabled!(cpu_left_legend, matches, config);
let (default_widget_type, mut default_widget_count) =
get_default_widget_and_count(matches, config)?;
@@ -402,7 +402,7 @@ pub fn get_widget_layout(
&mut default_widget_id,
&default_widget_type,
&mut default_widget_count,
- left_legend,
+ cpu_left_legend,
)
})
.collect::<error::Result<Vec<_>>>()?,
diff --git a/src/options/args.rs b/src/options/args.rs
index c8fe35320..a9d550bb 100644
--- a/src/options/args.rs
+++ b/src/options/args.rs
@@ -41,6 +41,18 @@ macro_rules! args {
};
}
+const CHART_WIDGET_POSITIONS: [&str; 9] = [
+ "none",
+ "top-left",
+ "top",
+ "top-right",
+ "left",
+ "right",
+ "bottom-left",
+ "bottom",
+ "bottom-right",
+];
+
fn general_args(cmd: Command) -> Command {
let cmd = cmd.next_help_heading("General Options");
@@ -49,9 +61,8 @@ fn general_args(cmd: Command) -> Command {
.action(ArgAction::SetTrue)
.help("Temporarily shows the time scale in graphs.")
.long_help(
- "Automatically hides the time scale in graphs after being shown for \
- a brief moment when zoomed in/out. If time is disabled via --hide_time \
- then this will have no effect.",
+ "Automatically hides the time scale in graphs after being shown for a brief moment when zoomed \
+ in/out. If time is disabled via --hide_time then this will have no effect."
);
let basic = Arg::new("basic")
@@ -59,47 +70,7 @@ fn general_args(cmd: Command) -> Command {
.long("basic")
.action(ArgAction::SetTrue)
.help("Hides graphs and uses a more basic look.")
- .long_help(
- "Hides graphs and uses a more basic look. Design is largely inspired by htop's.",
- );
-
- let disable_click = Arg::new("disable_click")
- .long("disable_click")
- .action(ArgAction::SetTrue)
- .help("Disables mouse clicks.")
- .long_help("Disables mouse clicks from interacting with the program.");
-
- let dot_marker = Arg::new("dot_marker")
- .short('m')
- .long("dot_marker")
- .action(ArgAction::SetTrue)
- .help("Uses a dot marker for graphs.")
- .long_help("Uses a dot marker for graphs as opposed to the default braille marker.");
-
- let hide_table_gap = Arg::new("hide_table_gap")
- .long("hide_table_gap")
- .action(ArgAction::SetTrue)
- .help("Hides spacing between table headers and entries.")
- .long_help("Hides the spacing between table headers and entries.");
-
- let hide_time = Arg::new("hide_time")
- .long("hide_time")
- .action(ArgAction::SetTrue)
- .help("Hides the time scale.")
- .long_help("Completely hides the time scale from being shown.");
-
- let left_legend = Arg::new("left_legend")
- .short('l')
- .long("left_legend")
- .action(ArgAction::SetTrue)
- .help("Puts the CPU chart legend to the left side.")
- .long_help("Puts the CPU chart legend to the left side rather than the right side.");
-
- let show_table_scroll_position = Arg::new("show_table_scroll_position")
- .long("show_table_scroll_position")
- .action(ArgAction::SetTrue)
- .help("Shows the scroll position tracker in table widgets.")
- .long_help("Shows the list scroll position tracker in the widget title for table widgets.");
+ .long_help("Hides graphs and uses a more basic look, largely inspired by htop's design.");
let config_location = Arg::new("config_location")
.short('C')
@@ -108,8 +79,9 @@ fn general_args(cmd: Command) -> Command {
.value_name("CONFIG PATH")
.help("Sets the location of the config file.")
.long_help(
- "Sets the location of the config file. Expects a config file in the TOML format.\
- If it doesn't exist, one is created.",
+ "Sets the location of the config file. Expects a config file in the TOML format. \
+ If it doesn't exist, a default config file is created at the path. If no path is provided, \
+ the default config location will be used."
)
.value_hint(ValueHint::AnyPath);
@@ -120,8 +92,8 @@ fn general_args(cmd: Command) -> Command {
.value_name("TIME")
.help("Default time value for graphs.")
.long_help(
- "Default time value for graphs. Takes a number in milliseconds or a human \
- duration (e.g. 60s). The minimum time is 30s, and the default is 60s.",
+ "Default time value for graphs. Either a number in milliseconds or a 'human duration' \
+ (e.g. 60s, 10m). Defaults to 60s, must be at least 30s.",
);
// TODO: Charts are broken in the manpage
@@ -129,31 +101,29 @@ fn general_args(cmd: Command) -> Command {
.long("default_widget_count")
.action(ArgAction::Set)
.requires_all(["default_widget_type"])
- .value_name("INT")
- .help("Sets the n'th selected widget type as the default.")
+ .value_name("N")
+ .help("Sets the N'th selected widget type as the default.")
.long_help(indoc! {
- "Sets the n'th selected widget type to use as the default widget.
- Requires 'default_widget_type' to also be set, and defaults to 1.
+ "Sets the N'th selected widget type to use as the default widget. Requires 'default_widget_type' to also be \
+ set, and defaults to 1.
- This reads from left to right, top to bottom. For example, suppose
- we have a layout that looks like:
+ This reads from left to right, top to bottom. For example, suppose we have a layout that looks like:
+-------------------+-----------------------+
| CPU (1) | CPU (2) |
+---------+---------+-------------+---------+
| Process | CPU (3) | Temperature | CPU (4) |
+---------+---------+-------------+---------+
- And we set our default widget type to 'CPU'. If we set
- '--default_widget_count 1', then it would use the CPU (1) as
- the default widget. If we set '--default_widget_count 3', it would
- use CPU (3) as the default instead."
+ And we set our default widget type to 'CPU'. If we set '--default_widget_count 1', then it would use the \
+ CPU (1) as the default widget. If we set '--default_widget_count 3', it would use CPU (3) as the default \
+ instead."
});
let default_widget_type = Arg::new("default_widget_type")
.long("default_widget_type")
.action(ArgAction::Set)
- .value_name("WIDGET TYPE")
- .help("Sets the default widget type, use --help for info.")
+ .value_name("WIDGET")
+ .help("Sets the default widget type, use `--help` for info.")
.long_help(indoc!{
"Sets which widget type to use as the default widget. For the default \
layout, this defaults to the 'process' widget. For a custom layout, it defaults \
@@ -166,7 +136,7 @@ fn general_args(cmd: Command) -> Command {
| Process | CPU (3) | Temperature | CPU (4) |
+---------+---------+-------------+---------+
- Setting '--default_widget_type Temp' will make the temperature widget selected by default."
+ Setting '--default_widget_type temperature' will make the temperature widget selected by default."
})
.value_parser([
"cpu",
@@ -179,36 +149,73 @@ fn general_args(cmd: Command) -> Command {
"temp",
"temperature",
"disk",
- #[cfg(not(feature = "battery"))]
+ #[cfg(feature = "battery")]
"batt",
- #[cfg(not(feature = "battery"))]
+ #[cfg(feature = "battery")]
"battery",
]);
- let expanded_on_startup = Arg::new("expanded_on_startup")
+ let disable_click = Arg::new("disable_click")
+ .long("disable_click")
+ .action(ArgAction::SetTrue)
+ .help("Disables mouse clicks.")
+ .long_help("Disables mouse clicks from interacting with bottom.");
+
+ // TODO: Change this to accept a string with the type of marker.
+ let dot_marker = Arg::new("dot_marker")
+ .short('m')
+ .long("dot_marker")
+ .action(ArgAction::SetTrue)
+ .help("Uses a dot marker for graphs.")
+ .long_help("Uses a dot marker for graphs as opposed to the default braille marker.");
+
+ let expanded = Arg::new("expanded")
.short('e')
.long("expanded")
.action(ArgAction::SetTrue)
.help("Expand the default widget upon starting the app.")
- .long_help(
- "Expand the default widget upon starting the app. \
- Same as pressing \"e\" inside the app. Use with \"default_widget_type\" \
- and \"default_widget_count\" to select the desired expanded widget. This \
- flag has no effect in basic mode (--basic).",
- );
+ .long_help("Expand the default widget upon starting the app. This flag has no effect in basic mode (--basic).");
+
+ let hide_table_gap = Arg::new("hide_table_gap")
+ .long("hide_table_gap")
+ .action(ArgAction::SetTrue)
+ .help("Hides spacing between table headers and entries.");
+
+ let hide_time = Arg::new("hide_time")
+ .long("hide_time")
+ .action(ArgAction::SetTrue)
+ .help("Hides the time scale from being shown.");
let rate = Arg::new("rate")
.short('r')
.long("rate")
.action(ArgAction::Set)
.value_name("TIME")
- .help("Sets the data refresh rate.")
+ .help("Sets how often data is refreshed.")
.long_help(
- "Sets the data refresh rate. Takes a number in milliseconds or a human\
- duration (e.g. 5s). The minimum is 250ms, and defaults to 1000ms. Smaller \
- values may take more computer resources.",
+ "Sets how often data is refreshed. Either a number in milliseconds or a 'human duration' \
+ (e.g. 1s, 1m). Defaults to 1s, must be at least 250ms. Smaller values may result in \
+ higher system resource usage."
);
+ // TODO: Unify how we do defaults.
+ let retention = Arg::new("retention")
+ .long("retention")
+ .action(ArgAction::Set)
+ .value_name("TIME")
+ .help("How far back data will be stored up to.")
+ .long_help(
+ "How far back data will be stored up to. Either a number in milliseconds or a 'human duration' \
+ (e.g. 10m, 1h). Defaults to 10 minutes, and must be at least 1 minute. Larger values \
+ may result in higher memory usage."
+ );
+
+ let show_table_scroll_position = Arg::new("show_table_scroll_position")
+ .long("show_table_scroll_position")
+ .action(ArgAction::SetTrue)
+ .help("Shows the scroll position tracker in table widgets.")
+ .long_help("Shows the list scroll position tracker in the widget title for table widgets.");
+
let time_delta = Arg::new("time_delta")
.short('d')
.long("time_delta")
@@ -221,104 +228,25 @@ fn general_args(cmd: Command) -> Command {
defaults to 15s.",
);
- // TODO: Unify how we do defaults.
- let retention = Arg::new("retention")
- .long("retention")
- .action(ArgAction::Set)
- .value_name("TIME")
- .help("The timespan of data stored.")
- .long_help(
- "How much data is stored at once in terms of time. Takes a number \
- in milliseconds or a human duration (e.g. 20m), with a minimum of 1 minute. \
- Note that higher values will take up more memory. Defaults to 10 minutes.",
- );
-
cmd.args(args![
autohide_time,
basic,
+ config_location,
+ default_widget_count,
+ default_time_value,
+ default_widget_type,
disable_click,
dot_marker,
+ expanded,
hide_table_gap,
hide_time,
- left_legend,
- show_table_scroll_position,
- config_location,
- default_time_value,
- default_widget_count,
- default_widget_type,
- expanded_on_startup,
rate,
- time_delta,
retention,
+ show_table_scroll_position,
+ time_delta,
])
}
-fn style_args(cmd: Command) -> Command {
- let cmd = cmd.next_help_heading("Style Options");
-
- // TODO: File an issue with manpage, it cannot render charts correctly.
- let color = Arg::new("color")
- .long("color")
- .action(ArgAction::Set)
- .value_name("COLOR SCHEME")
- .value_parser([
- "default",
- "default-light",
- "gruvbox",
- "gruvbox-light",
- "nord",
- "nord-light",
- ])
- .hide_possible_values(true)
- .help(
- "Use a color scheme, use --help for info on the colors. \
- [pos