summaryrefslogtreecommitdiffstats
path: root/src/options.rs
diff options
context:
space:
mode:
authorClementTsang <clementjhtsang@gmail.com>2020-04-19 17:45:32 -0400
committerClementTsang <clementjhtsang@gmail.com>2020-04-19 17:45:32 -0400
commitf334a72fb15bfef8c8f68d8317aa14f52e360c84 (patch)
tree23e59359b553bbfc82cff28f55f1d1fbc30f1821 /src/options.rs
parentb42583e04cee1d6a6bc67fa30c4b0777e1333f0a (diff)
Made table gap optional rather than enforced
Diffstat (limited to 'src/options.rs')
-rw-r--r--src/options.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/options.rs b/src/options.rs
index 86110a49..f2fa00e3 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -41,6 +41,7 @@ pub struct ConfigFlags {
pub default_widget_type: Option<String>,
pub default_widget_count: Option<u64>,
pub use_old_network_legend: Option<bool>,
+ pub hide_table_gap : Option<bool>,
//disabled_cpu_cores: Option<Vec<u64>>, // TODO: [FEATURE] Enable disabling cores in config/flags
}
@@ -218,6 +219,7 @@ pub fn build_app(
hide_time: get_hide_time(matches, config),
autohide_time,
use_old_network_legend: get_use_old_network_legend(matches, config),
+ table_gap: if get_hide_table_gap(matches, config){0}else{1},
};
let used_widgets = UsedWidgets {
@@ -618,3 +620,17 @@ pub fn get_use_old_network_legend(matches: &clap::ArgMatches<'static>, config: &
}
false
}
+
+pub fn get_hide_table_gap(matches: &clap::ArgMatches<'static>, config: &Config) -> bool {
+ if matches.is_present("HIDE_TABLE_GAP") {
+ return true;
+ } else if let Some(flags) = &config.flags {
+ if let Some(hide_table_gap) = flags.hide_table_gap {
+ if hide_table_gap {
+ return true;
+ }
+ }
+ }
+ false
+}
+