diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2021-05-06 23:35:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-06 23:35:30 -0400 |
commit | ae59489466eb7bea0cce87d9cdcdd4d2bfb0e77d (patch) | |
tree | df903b51784ec9050f819a0a579040e0b4dd03fc /src | |
parent | fbfa708d1dfc54fffbc14f9468dd6feeb123a971 (diff) |
other: make advanced kill default (#463)
We make the advanced kill menu the default instead. You can opt out with disable_advanced_kill.
Diffstat (limited to 'src')
-rw-r--r-- | src/clap.rs | 10 | ||||
-rw-r--r-- | src/constants.rs | 4 | ||||
-rw-r--r-- | src/options.rs | 12 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/clap.rs b/src/clap.rs index 98ec58ef..8b5e22b2 100644 --- a/src/clap.rs +++ b/src/clap.rs @@ -187,12 +187,12 @@ Puts the CPU chart legend to the left side rather than the right side.\n\n", When searching for a process, enables regex by default.\n\n", ); - let advanced_kill = Arg::with_name("advanced_kill") - .long("advanced_kill") - .help("Shows more options when killing a process on Unix-like systems.") + let disable_advanced_kill = Arg::with_name("disable_advanced_kill") + .long("disable_advanced_kill") + .help("Hides advanced options to stop a process on Unix-like systems.") .long_help( "\ -Shows more options when killing a process on Unix-like systems.\n\n", +Hides advanced options to stop a process on Unix-like systems. The only option shown is -15.\n\n", ); let show_table_scroll_position = Arg::with_name("show_table_scroll_position") @@ -441,7 +441,7 @@ Displays the network widget with binary prefixes (i.e. kibibits, mebibits) rathe .arg(hide_time) .arg(show_table_scroll_position) .arg(left_legend) - .arg(advanced_kill) + .arg(disable_advanced_kill) // .arg(no_write) .arg(rate) .arg(regex) diff --git a/src/constants.rs b/src/constants.rs index 5a9f4220..f85904bb 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -496,8 +496,8 @@ pub const CONFIG_TEXT: &str = r##"# This is a default config file for bottom. A #network_use_bytes = false # Displays the network widget with a log scale. #network_use_log = false -# Show a more advanced process kill screen -#advanced_kill = false +# Hides advanced options to stop a process on Unix-like systems. +#disable_advanced_kill = false # These are all the components that support custom theming. Note that colour support # will depend on terminal support. diff --git a/src/options.rs b/src/options.rs index 9dcd8123..45aee033 100644 --- a/src/options.rs +++ b/src/options.rs @@ -158,7 +158,7 @@ pub struct ConfigFlags { pub process_command: Option<bool>, #[builder(default, setter(strip_option))] - pub advanced_kill: Option<bool>, + pub disable_advanced_kill: Option<bool>, #[builder(default, setter(strip_option))] pub network_use_bytes: Option<bool>, @@ -285,7 +285,7 @@ pub fn build_app( let show_memory_as_values = get_mem_as_value(matches, config); let is_default_tree = get_is_default_tree(matches, config); let is_default_command = get_is_default_process_command(matches, config); - let is_advanced_kill = get_is_using_advanced_kill(matches, config); + let is_advanced_kill = !get_is_advanced_kill_disabled(matches, config); let network_unit_type = get_network_unit_type(matches, config); let network_scale_type = get_network_scale_type(matches, config); @@ -1044,12 +1044,12 @@ fn get_is_default_process_command(matches: &clap::ArgMatches<'static>, config: & false } -fn get_is_using_advanced_kill(matches: &clap::ArgMatches<'static>, config: &Config) -> bool { - if matches.is_present("advanced_kill") { +fn get_is_advanced_kill_disabled(matches: &clap::ArgMatches<'static>, config: &Config) -> bool { + if matches.is_present("disable_advanced_kill") { return true; } else if let Some(flags) = &config.flags { - if let Some(advanced_kill) = flags.advanced_kill { - return advanced_kill; + if let Some(disable_advanced_kill) = flags.disable_advanced_kill { + return disable_advanced_kill; } } false |