mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-14 21:51:24 -05:00
Correct CLI help messages on Windows
* Prevents keepassxc-cli.exe -> keepassxc-cli show.exe * Fixes #3032
This commit is contained in:
parent
5b28610c6a
commit
7d46ce3de1
@ -84,7 +84,7 @@ int Add::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli add");
|
||||
errorTextStream << parser.helpText().replace("[options]", "add [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ int Clip::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2 && args.size() != 3) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli clip");
|
||||
errorTextStream << parser.helpText().replace("[options]", "clip [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ int Create::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() < 1) {
|
||||
out << parser.helpText().replace("keepassxc-cli", "keepassxc-cli create");
|
||||
out << parser.helpText().replace("[options]", "create [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ int Diceware::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (!args.isEmpty()) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli diceware");
|
||||
errorTextStream << parser.helpText().replace("[options]", "diceware [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ int Diceware::execute(const QStringList& arguments)
|
||||
}
|
||||
|
||||
if (!dicewareGenerator.isValid()) {
|
||||
outputTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli diceware");
|
||||
outputTextStream << parser.helpText().replace("[options]", "diceware [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ int Edit::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli edit");
|
||||
errorTextStream << parser.helpText().replace("[options]", "edit [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ int Estimate::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() > 1) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli estimate");
|
||||
errorTextStream << parser.helpText().replace("[options]", "estimate [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ int Extract::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 1) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli extract");
|
||||
errorTextStream << parser.helpText().replace("[options]", "extract [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ int Generate::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (!args.isEmpty()) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli generate");
|
||||
errorTextStream << parser.helpText().replace("[options]", "generate [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ int Generate::execute(const QStringList& arguments)
|
||||
passwordGenerator.setExcludedChars(parser.value(exclude));
|
||||
|
||||
if (!passwordGenerator.isValid()) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli generate");
|
||||
errorTextStream << parser.helpText().replace("[options]", "generate [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ int List::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 1 && args.size() != 2) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli ls");
|
||||
errorTextStream << parser.helpText().replace("[options]", "ls [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ int Locate::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli locate");
|
||||
errorTextStream << parser.helpText().replace("[options]", "locate [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ int Merge::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli merge");
|
||||
errorTextStream << parser.helpText().replace("[options]", "merge [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ int Remove::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli rm");
|
||||
errorTextStream << parser.helpText().replace("[options]", "rm [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ int Show::execute(const QStringList& arguments)
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2) {
|
||||
errorTextStream << parser.helpText().replace("keepassxc-cli", "keepassxc-cli show");
|
||||
errorTextStream << parser.helpText().replace("[options]", "show [options]");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user