bug: Fix missing config options in docs and default config (#542)

Adds the missing hide_time and battery config option to the default config and corresponding documentation.

Should probably automate the generation of this somehow tbh, though this might change when I add in-app config (soon™)
This commit is contained in:
Clement Tsang 2021-07-14 19:08:54 -04:00 committed by GitHub
parent 7392b56364
commit 968b7bb2de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 5 deletions

View File

@ -27,7 +27,7 @@ The following flags can be provided to bottom in the command line to change the
| `-h, --help` | Prints help information. Use --help for more info. |
| `-a, --hide_avg_cpu` | Hides the average CPU usage. |
| `--hide_table_gap` | Hides the spacing between table headers and entries. |
| `--hide_time` | Completely hides the time scaling. |
| `--hide_time` | Hides the time scale. |
| `-k, --kelvin` | Sets the temperature type to Kelvin. |
| `-l, --left_legend` | Puts the CPU chart legend to the left side. |
| `--mem_as_value` | Defaults to showing process memory usage by value. |

View File

@ -22,6 +22,7 @@ Most of the [command line flags](../../command-line-flags) have config file equi
| `rate` | Unsigned Int (represents milliseconds) | Sets a refresh rate in ms. |
| `default_time_value` | Unsigned Int (represents milliseconds) | Default time value for graphs in ms. |
| `time_delta` | Unsigned Int (represents milliseconds) | The amount in ms changed upon zooming. |
| `hide_time` | Boolean | Hides the time scaling. |
| `temperature_type` | String (one of ["k", "f", "c", "kelvin", "fahrenheit", "celsius"]) | Sets the temperature unit type. |
| `default_widget_type` | String (one of ["cpu", "proc", "net", "temp", "mem", "disk"], same as layout options) | Sets the default widget type, use --help for more info. |
| `default_widget_count` | Unsigned Int (represents which `default_widget_type`) | Sets the n'th selected widget type as the default. |

View File

@ -146,7 +146,7 @@ Hides the spacing between table headers and entries.\n\n",
let hide_time = Arg::with_name("hide_time")
.long("hide_time")
.help("Completely hides the time scaling.")
.help("Hides the time scale.")
.long_help(
"\
Completely hides the time scaling from being shown.\n\n",

View File

@ -469,6 +469,8 @@ pub const CONFIG_TEXT: &str = r##"# This is a default config file for bottom. A
#default_time_value = 60000
# The time delta on each zoom in/out action (in milliseconds).
#time_delta = 15000
# Hides the time scale.
#hide_time = false
# Override layout default widget
#default_widget_type = "proc"
#default_widget_count = 1
@ -478,6 +480,8 @@ pub const CONFIG_TEXT: &str = r##"# This is a default config file for bottom. A
#use_old_network_legend = false
# Remove space in tables
#hide_table_gap = false
# Show the battery widgets
#battery = false
# Disable mouse clicks
#disable_click = false
# Built-in themes. Valid values are "default", "default-light", "gruvbox", "gruvbox-light", "nord", "nord-light"

View File

@ -79,9 +79,6 @@ pub struct ConfigFlags {
#[builder(default, setter(strip_option))]
pub regex: Option<bool>,
#[builder(default, setter(strip_option))]
pub default_widget: Option<String>,
#[builder(default, setter(strip_option))]
pub basic: Option<bool>,
@ -145,6 +142,7 @@ pub struct ConfigFlags {
#[builder(default, setter(strip_option))]
pub search_regex_enabled_widgets: Option<Vec<WidgetIdEnabled>>,
// End hack
#[builder(default, setter(strip_option))]
pub mem_as_value: Option<bool>,