From 716c7722cda29bf612508bb96f51822a86e0f69e Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Sat, 20 Mar 2021 00:50:31 +0000 Subject: Add TUI, resolve #19, #17, #16 (#21) --- src/command/history.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/command/history.rs') diff --git a/src/command/history.rs b/src/command/history.rs index bd440163..af8aef7d 100644 --- a/src/command/history.rs +++ b/src/command/history.rs @@ -35,6 +35,12 @@ pub enum Cmd { #[structopt(long, short)] session: bool, }, + + #[structopt( + about="search for a command", + aliases=&["se", "sea", "sear", "searc"], + )] + Search { query: Vec }, } fn print_list(h: &[History]) { @@ -102,6 +108,13 @@ impl Cmd { Ok(()) } + + Self::Search { query } => { + let history = db.prefix_search(&query.join(""))?; + print_list(&history); + + Ok(()) + } } } } -- cgit v1.3.1