diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-03-20 00:50:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-20 00:50:31 +0000 |
| commit | 716c7722cda29bf612508bb96f51822a86e0f69e (patch) | |
| tree | fa3c4c192fc05b078397fcd510d39ae78e46abfa /src/command/history.rs | |
| parent | Add config file support (#15) (diff) | |
| download | atuin-716c7722cda29bf612508bb96f51822a86e0f69e.zip | |
Add TUI, resolve #19, #17, #16 (#21)
Diffstat (limited to 'src/command/history.rs')
| -rw-r--r-- | src/command/history.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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<String> }, } 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(()) + } } } } |
