From e149a0a6e9747b238032321f5e1554d0d8ded118 Mon Sep 17 00:00:00 2001 From: Tom Cammann Date: Tue, 11 Apr 2023 09:39:23 +0100 Subject: 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 ``` --- docs/docs/commands/search.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/docs/commands/search.md b/docs/docs/commands/search.md index eacb22e2..d33b7556 100644 --- a/docs/docs/commands/search.md +++ b/docs/docs/commands/search.md @@ -22,6 +22,7 @@ appended with a wildcard). | `--limit` | Limit the number of results (default: none) | | `--offset` | Offset from the start of the results (default: none) | | `--delete` | Delete history matching this query | +| `--reverse` | Reverse order of search results, oldest first | ## Examples @@ -48,5 +49,8 @@ atuin search --delete --exit 0 --after "yesterday 3pm" cargo atuin search --limit 1 cargo # Search for a single result for a command beginning with cargo, skipping (offsetting) one result -atuin search --offset 1 --limit cargo +atuin search --offset 1 --limit 1 cargo + +# Find the oldest cargo command +atuin search --limit 1 --reverse cargo ``` -- cgit v1.3.1