Skip to content

Conversation

@azaleacolburn
Copy link
Contributor

@azaleacolburn azaleacolburn commented Mar 15, 2025

Description

Adds clearer error messages when no matches are found in a query as per #952.

An error message for the command:
./target/debug/zoxide query foo bar baz
Would now read:
zoxide: no match found for 'foo', 'bar', and 'baz'
Instead of:
zoxide: no match found

The intention is to differentiate the error for zoxide: command not found and to provide clarity.

Warning

This PR adds the method format_keywords to the Query struct. It is run during every query because of how expected errors are managed with context. It clones self.keywords; if this is undesirable, it can be refactored.

@ajeetdsouza
Copy link
Owner

I'm not convinced that this feature would be useful, see: #952 (comment)

@azaleacolburn azaleacolburn deleted the clearer-no-match-errors branch March 29, 2025 20:30
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