Global const for KeyFileOption (CLI) (#2505)

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

No files matched your search

+2 -6
View File
@@ -49,11 +49,7 @@ int Add::execute(const QStringList& arguments)
parser.setApplicationDescription(description);
parser.addPositionalArgument("database", QObject::tr("Path of the database."));
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);
QCommandLineOption username(QStringList() << "u" << "username",
QObject::tr("Username for the entry."),
@@ -91,7 +87,7 @@ int Add::execute(const QStringList& arguments)
const QString& entryPath = args.at(1);
auto db = Database::unlockFromStdin(databasePath,
parser.value(keyFile),
parser.value(Command::KeyFileOption),
parser.isSet(Command::QuietOption) ? Utils::DEVNULL : Utils::STDOUT,
Utils::STDERR);
if (!db) {