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

CLI: Implement Search command and remove Group::locate #6805

Merged
merged 1 commit into from
Aug 22, 2021
Merged

CLI: Implement Search command and remove Group::locate #6805

merged 1 commit into from
Aug 22, 2021

Conversation

Molytho
Copy link
Contributor

@Molytho Molytho commented Aug 3, 2021

Group::locate does not use EntrySearcher and has a weird behaviour.
As discussed here (#6797) I refactored cli code to use EntrySearcher and removed Group::locate completely.

It changes behaviour of the clip command as it doesn't match against group hierarchy anymore when used with best-match option but this should stay mostly unnoticed because matching against group names is likely to result in multiple entries being found anyway.

Testing strategy

Added tests for search command
Available tests still pass without error

Type of change

  • ✅ Breaking change (causes existing functionality to change)
  • ✅ Refactor (significant modification to existing code)
  • ✅ Documentation (non-code change)

@droidmonkey droidmonkey added feature: CLI pr: refactoring Pull request that refactors code labels Aug 5, 2021
@droidmonkey droidmonkey added this to the v2.7.0 milestone Aug 22, 2021
* Introduce search CLI command to replace locate command. Search can provide the same functionality but in a more fine-grained fashion

* Replace use of Group::locate in code: Use EntrySearcher in clip cli command best-match option. This removes the matching against group hierarchy of an entry which is kind of nonsense as clip expects exactly one match. Matching against groups can be done using search command.

* Remove obsolete Group::locate method
Copy link
Member

@droidmonkey droidmonkey left a comment

Choose a reason for hiding this comment

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

I made some code cleanup edits, great work with this!

@droidmonkey droidmonkey merged commit e8f2c9d into keepassxreboot:develop Aug 22, 2021
@droidmonkey droidmonkey changed the title Remove Group::locate CLI: Implement Search command and remove Group::locate Feb 10, 2022
@witeshadow
Copy link

locate is used by AlfredApp and Raycast KeePassXC extensions.

@louib
Copy link
Member

louib commented Mar 30, 2022

@witeshadow you can use the search command in 2.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: CLI pr: refactoring Pull request that refactors code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants