Global const for KeyFileOption (CLI) (#2505)
This commit is contained in:
@@ -47,11 +47,9 @@ int Clip::execute(const QStringList& arguments)
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(description);
|
||||
parser.addPositionalArgument("database", QObject::tr("Path of the database."));
|
||||
QCommandLineOption keyFile(QStringList() << "k" << "key-file",
|
||||
QObject::tr("Key file of the database."),
|
||||
QObject::tr("path"));
|
||||
parser.addOption(keyFile);
|
||||
parser.addOption(Command::QuietOption);
|
||||
parser.addOption(Command::KeyFileOption);
|
||||
|
||||
QCommandLineOption totp(QStringList() << "t" << "totp",
|
||||
QObject::tr("Copy the current TOTP to the clipboard."));
|
||||
parser.addOption(totp);
|
||||
@@ -68,7 +66,7 @@ int Clip::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) {
|
||||
|
||||
Reference in New Issue
Block a user