summaryrefslogtreecommitdiffstats
path: root/atuin-client
diff options
context:
space:
mode:
Diffstat (limited to 'atuin-client')
-rw-r--r--atuin-client/src/database.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs
index a69570931..05ff559a4 100644
--- a/atuin-client/src/database.rs
+++ b/atuin-client/src/database.rs
@@ -78,7 +78,7 @@ pub trait Database: Send + Sync + 'static {
async fn load(&self, id: &str) -> Result<Option<History>>;
async fn list(
&self,
- filter: FilterMode,
+ filters: &[FilterMode],
context: &Context,
max: Option<usize>,
unique: bool,
@@ -271,7 +271,7 @@ impl Database for Sqlite {
// make a unique list, that only shows the *newest* version of things
async fn list(
&self,
- filter: FilterMode,
+ filters: &[FilterMode],
context: &Context,
max: Option<usize>,
unique: bool,
@@ -291,13 +291,15 @@ impl Database for Sqlite {
context.cwd.clone()
};
- match filter {
- FilterMode::Global => &mut query,
- FilterMode::Host => query.and_where_eq("hostname", quote(&context.hostname)),
- FilterMode::Session => query.and_where_eq("session", quote(&context.session)),
- FilterMode::Directory => query.and_where_eq("cwd", quote(&context.cwd)),
- FilterMode::Workspace => query.and_where_like_left("cwd", git_root),
- };
+ for filter in filters {
+ match filter {
+ FilterMode::Global => &mut query,
+ FilterMode::Host => query.and_where_eq("hostname", quote(&context.hostname)),
+ FilterMode::Session => query.and_where_eq("session", quote(&context.session)),
+ FilterMode::Directory => query.and_where_eq("cwd", quote(&context.cwd)),
+ FilterMode::Workspace => query.and_where_like_left("cwd", &git_root),
+ };
+ }
if unique {
query.and_where_eq(