diff options
| author | 依云 <lilydjwg@gmail.com> | 2025-03-24 19:16:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-24 11:16:26 +0000 |
| commit | 92ff75604d6bdcfa2e613569f2b288ae81436db5 (patch) | |
| tree | 44fa33ad514412114495e726825da91743fc104b /crates/atuin-client | |
| parent | docs: update logo and badges in README for zh-CN (#2392) (diff) | |
| download | atuin-92ff75604d6bdcfa2e613569f2b288ae81436db5.zip | |
feat: option to include duplicate commands when printing history commands (#2407)
Diffstat (limited to 'crates/atuin-client')
| -rw-r--r-- | crates/atuin-client/src/database.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/atuin-client/src/database.rs b/crates/atuin-client/src/database.rs index fd0284ba..de362766 100644 --- a/crates/atuin-client/src/database.rs +++ b/crates/atuin-client/src/database.rs @@ -51,6 +51,7 @@ pub struct OptFilters { pub limit: Option<i64>, pub offset: Option<i64>, pub reverse: bool, + pub include_duplicates: bool, } pub fn current_context() -> Context { @@ -410,7 +411,9 @@ impl Database for Sqlite { ) -> Result<Vec<History>> { let mut sql = SqlBuilder::select_from("history"); - sql.group_by("command").having("max(timestamp)"); + if !filter_options.include_duplicates { + sql.group_by("command").having("max(timestamp)"); + } if let Some(limit) = filter_options.limit { sql.limit(limit); |
