aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/client
diff options
context:
space:
mode:
authorTom Cammann <cammann.tom@gmail.com>2023-04-11 09:39:23 +0100
committerGitHub <noreply@github.com>2023-04-11 09:39:23 +0100
commite149a0a6e9747b238032321f5e1554d0d8ded118 (patch)
tree06c3e33912d6e3208b3931db77df02d5bebed4d8 /src/command/client
parentAtuin stats with day, month, week and year filter (#858) (diff)
downloadatuin-e149a0a6e9747b238032321f5e1554d0d8ded118.zip
Add `--reverse` to `atuin search` (#862)
Add `-r/--reverse` flag to `atuin search` to allow searching by oldest results first. Example to find the oldest `cargo` command: ``` atuin search --limit 1 --reverse cargo ```
Diffstat (limited to 'src/command/client')
-rw-r--r--src/command/client/search.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/command/client/search.rs b/src/command/client/search.rs
index f125b8bf..356ae251 100644
--- a/src/command/client/search.rs
+++ b/src/command/client/search.rs
@@ -83,6 +83,10 @@ pub struct Cmd {
#[arg(long)]
delete: bool,
+ /// Reverse the order of results, oldest first
+ #[arg(long, short)]
+ reverse: bool,
+
/// Available variables: {command}, {directory}, {duration}, {user}, {host}, {time}, {exit} and
/// {relativetime}.
/// Example: --format "{time} - [{duration}] - {directory}$\t{command}"
@@ -116,6 +120,7 @@ impl Cmd {
after: self.after,
limit: self.limit,
offset: self.offset,
+ reverse: self.reverse,
};
let mut entries =