Update documentation and added more flags for search as per last commit

This commit is contained in:
ClementTsang 2020-02-02 23:20:53 -05:00
parent fc3a2e69ec
commit 6551885666
3 changed files with 20 additions and 8 deletions

View file

@ -80,7 +80,11 @@ Run using `btm`.
- `-g`, `--group` will group together processes with the same name by default (equivalent to pressing `Tab`).
- `-i`, `--case_insensitive` will default to not matching case
- `-i`, `--case_insensitive` will default to not matching case.
- `-w`, `--whole` will default to searching for the world word.
- `-r`, `--regex` will default to using regex.
when searching processes.
@ -126,9 +130,13 @@ when searching processes.
#### Search Widget
- `Ctrl-p` or `Ctrl-n` to switch between searching for PID and name respectively.
- `Tab` to switch between searching for PID and name respectively.
- `Tab` to toggle whether to ignore case.
- `Alt-c` to toggle ignoring case.
- `Alt-m` to toggle matching the entire word.
- `Alt-r` to toggle using regex.
- `Ctrl-a` and `Ctrl-e` to jump to the start and end of the search bar respectively.

View file

@ -32,7 +32,7 @@ const WINDOWS_NETWORK_HEADERS: [&str; 2] = ["RX", "TX"];
const FORCE_MIN_THRESHOLD: usize = 5;
lazy_static! {
static ref HELP_TEXT: [Text<'static>; 20] = [
static ref HELP_TEXT: [Text<'static>; 22] = [
Text::raw("\nGeneral Keybindings\n"),
Text::raw("q, Ctrl-c to quit. Note if you are currently in the search widget, `q` will not work.\n"),
Text::raw("Ctrl-r to reset all data.\n"),
@ -52,8 +52,10 @@ lazy_static! {
Text::raw("Tab to group together processes with the same name.\n"),
Text::raw("Ctrl-f to toggle searching for a process. / to just open it.\n"),
Text::raw("Use Ctrl-p and Ctrl-n to toggle between searching for PID and name.\n"),
Text::raw("Use Ctrl-a and Ctrl-e to set the cursor to the start and end of the bar respectively.\n"),
Text::raw("Use Tab to toggle whether to ignore case.\n"),
Text::raw("Use Tab to set the cursor to the start and end of the bar respectively.\n"),
Text::raw("Use Alt-c to toggle whether to ignore case.\n"),
Text::raw("Use Alt-m to toggle matching the entire word.\n"),
Text::raw("Use Alt-r to toggle regex.\n"),
Text::raw("\nFor startup flags, type in \"btm -h\".")
];
static ref COLOUR_LIST: Vec<Color> = gen_n_colours(constants::NUM_COLOURS);

View file

@ -74,7 +74,9 @@ fn main() -> error::Result<()> {
//(@arg CONFIG_LOCATION: -co --config +takes_value "Sets the location of the config file. Expects a config file in the JSON format.")
//(@arg BASIC_MODE: -b --basic "Sets bottom to basic mode, not showing graphs and only showing basic tables.")
(@arg GROUP_PROCESSES: -g --group "Groups processes with the same name together on launch.")
(@arg CASE_INSENSITIVE_DEFAULT: -i --case_insensitive "Do not match case when searching processes by default.")
(@arg CASE_INSENSITIVE: -i --case_insensitive "Do not match case when searching by default.")
(@arg WHOLE_WORD: -w --whole "Match whole word when searching by default.")
(@arg REGEX_DEFAULT: -x --regex "Use regex in searching by default.")
)
.get_matches();
@ -132,7 +134,7 @@ fn main() -> error::Result<()> {
}
// Set default search method
if matches.is_present("CASE_INSENSITIVE_DEFAULT") {
if matches.is_present("CASE_INSENSITIVE") {
app.search_state.toggle_ignore_case();
}