Skip to content

Commit

Permalink
bug: Fix missing config options in docs and default config (#542)
Browse files Browse the repository at this point in the history
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™)
  • Loading branch information
ClementTsang committed Jul 14, 2021
1 parent 4d0eebf commit a2fa4d2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/content/configuration/command-line-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
1 change: 1 addition & 0 deletions docs/content/configuration/config-file/flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
2 changes: 1 addition & 1 deletion src/clap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,

Expand Down Expand Up @@ -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>,

Expand Down

0 comments on commit a2fa4d2

Please sign in to comment.