Global const for KeyFileOption (CLI) (#2505)

This commit is contained in:
louib 2018-11-28 16:15:15 -05:00 committed by Jonathan White
parent 1a2721529d
commit 49b82ea6a2
11 changed files with 34 additions and 55 deletions

View file

@ -49,10 +49,7 @@ int Locate::execute(const QStringList& arguments)
parser.addPositionalArgument("database", QObject::tr("Path of the database."));
parser.addPositionalArgument("term", QObject::tr("Search term."));
parser.addOption(Command::QuietOption);
QCommandLineOption keyFile(QStringList() << "k" << "key-file",
QObject::tr("Key file of the database."),
QObject::tr("path"));
parser.addOption(keyFile);
parser.addOption(Command::KeyFileOption);
parser.addHelpOption();
parser.process(arguments);
@ -63,7 +60,7 @@ int Locate::execute(const QStringList& arguments)
}
auto db = Database::unlockFromStdin(args.at(0),
parser.value(keyFile),
parser.value(Command::KeyFileOption),
parser.isSet(Command::QuietOption) ? Utils::DEVNULL : Utils::STDOUT,
Utils::STDERR);
if (!db) {