CLI: Replace locate command with search

* 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
This commit is contained in:
Robin Ebert 2021-08-03 15:37:47 +02:00 committed by Jonathan White
parent ec81d2bc3f
commit e8f2c9d126
12 changed files with 103 additions and 165 deletions

View file

@ -31,12 +31,12 @@
#include "Import.h"
#include "Info.h"
#include "List.h"
#include "Locate.h"
#include "Merge.h"
#include "Move.h"
#include "Open.h"
#include "Remove.h"
#include "RemoveGroup.h"
#include "Search.h"
#include "Show.h"
#include "Utils.h"
@ -173,7 +173,6 @@ namespace Commands
s_commands.insert(QStringLiteral("estimate"), QSharedPointer<Command>(new Estimate()));
s_commands.insert(QStringLiteral("generate"), QSharedPointer<Command>(new Generate()));
s_commands.insert(QStringLiteral("help"), QSharedPointer<Command>(new Help()));
s_commands.insert(QStringLiteral("locate"), QSharedPointer<Command>(new Locate()));
s_commands.insert(QStringLiteral("ls"), QSharedPointer<Command>(new List()));
s_commands.insert(QStringLiteral("merge"), QSharedPointer<Command>(new Merge()));
s_commands.insert(QStringLiteral("mkdir"), QSharedPointer<Command>(new AddGroup()));
@ -181,6 +180,7 @@ namespace Commands
s_commands.insert(QStringLiteral("open"), QSharedPointer<Command>(new Open()));
s_commands.insert(QStringLiteral("rm"), QSharedPointer<Command>(new Remove()));
s_commands.insert(QStringLiteral("rmdir"), QSharedPointer<Command>(new RemoveGroup()));
s_commands.insert(QStringLiteral("search"), QSharedPointer<Command>(new Search()));
s_commands.insert(QStringLiteral("show"), QSharedPointer<Command>(new Show()));
if (interactive) {