From 9999a4824a649695a8b462c02732b9a9ca5478ac Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Fri, 21 Feb 2025 06:04:08 -0500 Subject: [PATCH] docs: update documentation around how grouping processes and tree mode are incompatible (#1679) * update default config * use info, not note --- docs/content/configuration/command-line-options.md | 2 +- docs/content/usage/widgets/process.md | 14 ++++++++++++-- sample_configs/default_config.toml | 3 ++- src/constants.rs | 3 ++- src/options/args.rs | 4 +++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/content/configuration/command-line-options.md b/docs/content/configuration/command-line-options.md index f4e71a02..8e4286b3 100644 --- a/docs/content/configuration/command-line-options.md +++ b/docs/content/configuration/command-line-options.md @@ -30,7 +30,7 @@ see information on these options by running `btm -h`, or run `btm --help` to dis | `-S, --case_sensitive` | Enables case sensitivity by default. | | `-u, --current_usage` | Calculates process CPU usage as a percentage of current usage rather than total usage. | | `--disable_advanced_kill` | Hides additional stopping options Unix-like systems. | -| `-g, --group_processes` | Groups processes with the same name by default. | +| `-g, --group_processes` | Groups processes with the same name by default. No effect if `--tree` is set. | | `--process_memory_as_value` | Defaults to showing process memory usage by value. | | `--process_command` | Shows the full command name instead of the process name by default. | | `-R, --regex` | Enables regex by default while searching. | diff --git a/docs/content/usage/widgets/process.md b/docs/content/usage/widgets/process.md index 485a785f..38be51a2 100644 --- a/docs/content/usage/widgets/process.md +++ b/docs/content/usage/widgets/process.md @@ -64,7 +64,14 @@ is added together when displayed. A picture of grouped mode in a process widget. -Note that the process state and user columns are disabled in this mode. +!!! info + + Note that the process state and user columns are disabled in this mode. + +!!! info + + Note that if tree mode is also active, processes cannot be grouped together due to the behaviour of the two modes + somewhat clashing. This also reflects with default modes like `group_processes`. ### Process termination @@ -94,7 +101,10 @@ Pressing ++t++ or ++f5++ in the table toggles tree mode in the process widget, d A process in tree mode can also be "collapsed", hiding its children and any descendants, using either the ++minus++ or ++plus++ keys, or double-clicking on an entry. -Lastly, note that in tree mode, processes cannot be grouped together due to the behaviour of the two modes somewhat clashing. +!!! info + + Note that if tree mode is active, processes cannot be grouped together due to the behaviour of the two modes + somewhat clashing. This also reflects with default modes like `group_processes`. ### Full command diff --git a/sample_configs/default_config.toml b/sample_configs/default_config.toml index dae0e60f..aa450c41 100644 --- a/sample_configs/default_config.toml +++ b/sample_configs/default_config.toml @@ -24,7 +24,8 @@ # Whether to set CPU% on a process to be based on the total CPU or per-core CPU% (not divided by the number of cpus). #unnormalized_cpu = false -# Whether to group processes with the same name together by default. +# Whether to group processes with the same name together by default. Doesn't do anything +# if tree is set to true or --tree is set. #group_processes = false # Whether to make process searching case sensitive by default. diff --git a/src/constants.rs b/src/constants.rs index fba9869f..c3cfa7c4 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -283,7 +283,8 @@ pub(crate) const CONFIG_TEXT: &str = r#"# This is a default config file for bott # Whether to set CPU% on a process to be based on the total CPU or per-core CPU% (not divided by the number of cpus). #unnormalized_cpu = false -# Whether to group processes with the same name together by default. +# Whether to group processes with the same name together by default. Doesn't do anything +# if tree is set to true or --tree is set. #group_processes = false # Whether to make process searching case sensitive by default. diff --git a/src/options/args.rs b/src/options/args.rs index 55e25eca..54d10d9f 100644 --- a/src/options/args.rs +++ b/src/options/args.rs @@ -301,7 +301,9 @@ pub struct ProcessArgs { short = 'g', long, action = ArgAction::SetTrue, - help = "Groups processes with the same name by default." + help = "Groups processes with the same name by default.", + long_help = "Groups processes with the same name by default. Doesn't do anything if --tree is also set, or \ + tree=true in the config." )] pub group_processes: bool,