Skip to content

Commit

Permalink
other: update a bunch of argument descriptions and some arg/config na…
Browse files Browse the repository at this point in the history
…mes (#1441)

* other: update a bunch of argument descriptions and some arg/config names

* update docs

* changelog
  • Loading branch information
ClementTsang authored Apr 11, 2024
1 parent bb0bc8a commit 93d6718
Show file tree
Hide file tree
Showing 14 changed files with 327 additions and 359 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
118 changes: 59 additions & 59 deletions docs/content/configuration/command-line-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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. |
4 changes: 2 additions & 2 deletions docs/content/configuration/config-file/flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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. |
4 changes: 2 additions & 2 deletions sample_configs/default_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sample_configs/demo_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions schema/nightly/bottom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/canvas/widgets/cpu_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 93d6718

Please sign in to comment.