diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2022-04-22 21:05:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-22 21:05:02 +0100 |
| commit | 508d4f476157384b0d454bee3dd6e9256560561b (patch) | |
| tree | 9eb2fbc5a9a51d3419e9e684a01fe5a2106e77c9 /src/command/client/stats.rs | |
| parent | refactor (#327) (diff) | |
| download | atuin-508d4f476157384b0d454bee3dd6e9256560561b.zip | |
History filter (#329)
* Add history filters, and hotkey toggle
Switch between different search modes to narrow down the history you
want - global search for all history, host for all history from your
current machine, session for the current shell session, and directory
for the current directory
The default can be configured via `filter_mode`
* Update docs
* Add context
Diffstat (limited to '')
| -rw-r--r-- | src/command/client/stats.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/command/client/stats.rs b/src/command/client/stats.rs index 6d342c19..85c58cc0 100644 --- a/src/command/client/stats.rs +++ b/src/command/client/stats.rs @@ -8,9 +8,9 @@ use clap::Parser; use cli_table::{format::Justify, print_stdout, Cell, Style, Table}; use eyre::{bail, Result}; -use atuin_client::database::Database; +use atuin_client::database::{current_context, Database}; use atuin_client::history::History; -use atuin_client::settings::Settings; +use atuin_client::settings::{FilterMode, Settings}; #[derive(Parser)] #[clap(infer_subcommands = true)] @@ -71,6 +71,8 @@ impl Cmd { db: &mut (impl Database + Send + Sync), settings: &Settings, ) -> Result<()> { + let context = current_context(); + match self { Self::Day { words } => { let words = if words.is_empty() { @@ -90,7 +92,7 @@ impl Cmd { } Self::All => { - let history = db.list(None, false).await?; + let history = db.list(FilterMode::Global, &context, None, false).await?; compute_stats(&history)?; |
