From 2832ddebb07ee0ba63009735b47c576a670cc31e Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Fri, 17 Jan 2020 19:59:01 -0500 Subject: [PATCH] Updated documentation. --- README.md | 8 +++++++- src/canvas.rs | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b0e3546e..b62ec520 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,9 @@ Run using `btm`. - `-u`, `--current_usage` will make a process' CPU usage be based on the current total CPU usage, rather than assuming 100% CPU usage. Only affects Linux for now. -- `g`, `--group` will group together processes with the same name by default (equivalent to pressing `Tab`). +- `-g`, `--group` will group together processes with the same name by default (equivalent to pressing `Tab`). + +- `-s`, `--simple_search` will default the search to simple search rather than regex search. ### Keybindings @@ -122,6 +124,10 @@ Run using `btm`. - `Ctrl-p` or `Ctrl-n` to switch between searching for PID and name respectively. +- `Ctrl-s` to toggle between a simple search and a regex search. + +- `Ctrl-a` and `Ctrl-e` to jump to the start and end of the search bar respectively. + - `Esc` or `Ctrl-f` to close. Note that `q` is disabled while in the search widget. diff --git a/src/canvas.rs b/src/canvas.rs index 1d7a5fcc..dd1099d6 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -30,7 +30,7 @@ const WINDOWS_NETWORK_HEADERS: [&str; 2] = ["RX", "TX"]; const FORCE_MIN_THRESHOLD: usize = 5; lazy_static! { - static ref HELP_TEXT: [Text<'static>; 17] = [ + static ref HELP_TEXT: [Text<'static>; 20] = [ 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"), @@ -48,7 +48,10 @@ lazy_static! { Text::raw("p to sort by PID.\n"), Text::raw("n to sort by process name.\n"), 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. Use Ctrl-p and Ctrl-n to toggle between searching for PID and 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 Ctrl-s to toggle between simple and regex search.\n"), Text::raw("\nFor startup flags, type in \"btm -h\".") ]; static ref COLOUR_LIST: Vec = gen_n_colours(constants::NUM_COLOURS); @@ -158,9 +161,9 @@ pub fn draw_data( .margin(1) .constraints( [ - Constraint::Percentage(27), - Constraint::Percentage(50), - Constraint::Percentage(23), + Constraint::Percentage(22), + Constraint::Percentage(60), + Constraint::Percentage(18), ] .as_ref(), ) @@ -171,9 +174,9 @@ pub fn draw_data( .margin(0) .constraints( [ - Constraint::Percentage(30), - Constraint::Percentage(40), - Constraint::Percentage(30), + Constraint::Percentage(20), + Constraint::Percentage(60), + Constraint::Percentage(20), ] .as_ref(), )