Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --offset flag to atuin search #825

Merged
merged 1 commit into from
Mar 29, 2023
Merged

Conversation

takac
Copy link
Contributor

@takac takac commented Mar 28, 2023

This flag allows the user to continue searching at an offset. This is useful for building tools that use atuin to search for previous commands and return only one result.

# assuming atuin isn't recording the next few commands..

# return first result
atuin search --limit 1
# return second result
atuin search --limit 1 --offset 1
# so on..
atuin search --limit 1 --offset 2

@vercel
Copy link

vercel bot commented Mar 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
atuin ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 28, 2023 at 9:20PM (UTC)

@ellie
Copy link
Member

ellie commented Mar 28, 2023

We moved to using a struct for a bunch of these options - the function signature was getting pretty large! I like this change though, will allow third party integrations some more flexibility. Happy to approve once we've got it rebased!

This flag allows the user to continue searching at an offset. This is
useful for building tools that use atuin to search for previous
commands and return only one result.

```

atuin search --limit 1
atuin search --limit 1 --offset 1
atuin search --limit 1 --offset 2
```
Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thank you!

@ellie ellie merged commit fa0a144 into atuinsh:main Mar 29, 2023
@ellie
Copy link
Member

ellie commented Mar 29, 2023

Oh hang on - I always forget this 🤦‍♀️

would you be able to update the docs with this as well please? 🙏

https://github.com/ellie/atuin/blob/main/docs/docs/commands/search.md

@takac
Copy link
Contributor Author

takac commented Mar 29, 2023

Sure, will follow up on that

@takac takac deleted the search-with-offset branch March 29, 2023 10:02
@takac
Copy link
Contributor Author

takac commented Mar 29, 2023

#828

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants