summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--atuin-client/src/database.rs5
-rw-r--r--src/command/client/search.rs5
2 files changed, 10 insertions, 0 deletions
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs
index 1a577a706..6d364dbe2 100644
--- a/atuin-client/src/database.rs
+++ b/atuin-client/src/database.rs
@@ -34,6 +34,7 @@ pub struct OptFilters {
pub before: Option<String>,
pub after: Option<String>,
pub limit: Option<i64>,
+ pub offset: Option<i64>,
}
pub fn current_context() -> Context {
@@ -361,6 +362,10 @@ impl Database for Sqlite {
sql.limit(limit);
}
+ if let Some(offset) = filter_options.offset {
+ sql.offset(offset);
+ }
+
match filter {
FilterMode::Global => &mut sql,
FilterMode::Host => sql.and_where_eq("hostname", quote(&context.hostname)),
diff --git a/src/command/client/search.rs b/src/command/client/search.rs
index 7a4d365fd..9d05fe583 100644
--- a/src/command/client/search.rs
+++ b/src/command/client/search.rs
@@ -49,6 +49,10 @@ pub struct Cmd {
#[arg(long)]
limit: Option<i64>,
+ /// Offset from the start of the results
+ #[arg(long)]
+ offset: Option<i64>,
+
/// Open interactive search UI
#[arg(long, short)]
interactive: bool,
@@ -111,6 +115,7 @@ impl Cmd {
before: self.before,
after: self.after,
limit: self.limit,
+ offset: self.offset,
};
let mut entries =