summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2021-07-14 19:08:54 -0400
committerGitHub <noreply@github.com>2021-07-14 19:08:54 -0400
commit968b7bb2def503da068f9579384c34e2b2d3a506 (patch)
tree5d0b59aa59f4dd16875cd0cf72895b303fb6e831
parent7392b56364ef0df321160e519eb29c287ae94622 (diff)
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™)
-rw-r--r--docs/content/configuration/command-line-flags.md2
-rw-r--r--docs/content/configuration/config-file/flags.md1
-rw-r--r--src/clap.rs2
-rw-r--r--src/constants.rs4
-rw-r--r--src/options.rs4
5 files changed, 8 insertions, 5 deletions
diff --git a/docs/content/configuration/command-line-flags.md b/docs/content/configuration/command-line-flags.md
index 0f3d576a..b5d6d3d3 100644
--- a/docs/content/configuration/command-line-flags.md
+++ b/docs/content/configuration/command-line-flags.md
@@ -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. |
diff --git a/docs/content/configuration/config-file/flags.md b/docs/content/configuration/config-file/flags.md
index e4896828..b8a190a7 100644
--- a/docs/content/configuration/config-file/flags.md
+++ b/docs/content/configuration/config-file/flags.md
@@ -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. |
diff --git a/src/clap.rs b/src/clap.rs
index 8b5e22b2..908a1cce 100644
--- a/src/clap.rs
+++ b/src/clap.rs
@@ -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",
diff --git a/src/constants.rs b/src/constants.rs
index c810ccb9..2397e7b1 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -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"
diff --git a/src/options.rs b/src/options.rs
index dd1ce026..facd42fe 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -80,9 +80,6 @@ pub struct ConfigFlags {
pub regex: Option<bool>,
#[builder(default, setter(strip_option))]
- pub default_widget: Option<String>,
-
- #[builder(default, setter(strip_option))]
pub basic: Option<bool>,
#[builder(default, setter(strip_option))]
@@ -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>,