mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-22 23:22:05 +01:00
Set resource bundle for help command
This commit is contained in:
parent
fa52df385e
commit
7de94f1815
5 changed files with 17 additions and 8 deletions
|
@ -64,15 +64,20 @@ public class SopCLI {
|
||||||
// Set locale
|
// Set locale
|
||||||
new CommandLine(new InitLocale()).parseArgs(args);
|
new CommandLine(new InitLocale()).parseArgs(args);
|
||||||
|
|
||||||
|
// get error message bundle
|
||||||
cliMsg = ResourceBundle.getBundle("sop");
|
cliMsg = ResourceBundle.getBundle("sop");
|
||||||
|
|
||||||
// Prepare CLI
|
// Prepare CLI
|
||||||
CommandLine cmd = new CommandLine(SopCLI.class);
|
CommandLine cmd = new CommandLine(SopCLI.class);
|
||||||
// Hide generate-completion command
|
|
||||||
CommandLine gen = cmd.getSubcommands().get("generate-completion");
|
|
||||||
gen.getCommandSpec().usageMessage().hidden(true);
|
|
||||||
|
|
||||||
cmd.setExecutionExceptionHandler(new SOPExecutionExceptionHandler())
|
// explicitly set help command resource bundle
|
||||||
|
cmd.getSubcommands().get("help").setResourceBundle(ResourceBundle.getBundle("help"));
|
||||||
|
|
||||||
|
// Hide generate-completion command
|
||||||
|
cmd.getSubcommands().get("generate-completion").getCommandSpec().usageMessage().hidden(true);
|
||||||
|
|
||||||
|
cmd.setCommandName(EXECUTABLE_NAME)
|
||||||
|
.setExecutionExceptionHandler(new SOPExecutionExceptionHandler())
|
||||||
.setExitCodeExceptionMapper(new SOPExceptionExitCodeMapper())
|
.setExitCodeExceptionMapper(new SOPExceptionExitCodeMapper())
|
||||||
.setCaseInsensitiveEnumValuesAllowed(true);
|
.setCaseInsensitiveEnumValuesAllowed(true);
|
||||||
|
|
||||||
|
|
4
sop-java-picocli/src/main/resources/help.properties
Normal file
4
sop-java-picocli/src/main/resources/help.properties
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Display usage information for the specified subcommand
|
4
sop-java-picocli/src/main/resources/help_de.properties
Normal file
4
sop-java-picocli/src/main/resources/help_de.properties
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Zeige Nutzungshilfen für den angegebenen Unterbefehl an
|
|
@ -31,8 +31,6 @@ usage.exitCodeList.16=71:Unsupported special prefix (e.g. \"@env/@fd\") of indir
|
||||||
usage.exitCodeList.17=73:Ambiguous input (a filename matching the designator already exists)
|
usage.exitCodeList.17=73:Ambiguous input (a filename matching the designator already exists)
|
||||||
usage.exitCodeList.18=79:Key is not signing capable
|
usage.exitCodeList.18=79:Key is not signing capable
|
||||||
|
|
||||||
help.usage.header=Display usage information for the specified subcommand
|
|
||||||
|
|
||||||
## SHARED RESOURCES
|
## SHARED RESOURCES
|
||||||
## Malformed Input
|
## Malformed Input
|
||||||
sop.error.input.malformed_session_key=Session keys are expected in the format 'ALGONUM:HEXKEY'.
|
sop.error.input.malformed_session_key=Session keys are expected in the format 'ALGONUM:HEXKEY'.
|
||||||
|
|
|
@ -31,8 +31,6 @@ usage.exitCodeList.16=71:Nicht unterst
|
||||||
usage.exitCodeList.17=73:Mehrdeutige Eingabe (ein Dateiname, der dem Bezeichner entspricht, existiert bereits)
|
usage.exitCodeList.17=73:Mehrdeutige Eingabe (ein Dateiname, der dem Bezeichner entspricht, existiert bereits)
|
||||||
usage.exitCodeList.18=79:Schlüssel ist nicht fähig zu signieren
|
usage.exitCodeList.18=79:Schlüssel ist nicht fähig zu signieren
|
||||||
|
|
||||||
sop.help.usage.header=Zeige Nutzungshilfen für den angegebenen Unterbefehl an
|
|
||||||
|
|
||||||
## SHARED RESOURCES
|
## SHARED RESOURCES
|
||||||
## Malformed Input
|
## Malformed Input
|
||||||
sop.error.input.malformed_session_key=Nachrichtenschlüssel werden im folgenden Format erwartet: 'ALGONUM:HEXKEY'
|
sop.error.input.malformed_session_key=Nachrichtenschlüssel werden im folgenden Format erwartet: 'ALGONUM:HEXKEY'
|
||||||
|
|
Loading…
Reference in a new issue