Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Make --language option mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
felsenhower committed Nov 24, 2020
1 parent 2f52a51 commit f604bc4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public CallLevelWrapper(String[] args) throws IOException {
}
}
} else {
strings = new StringProvider(new Locale(Locale.getDefault().getLanguage()));
strings = new StringProvider(Locale.ENGLISH);
}
} catch (Exception e) {
strings = new StringProvider(Locale.ENGLISH);
Expand All @@ -103,7 +103,7 @@ public CallLevelWrapper(String[] args) throws IOException {
if (cmd.hasOption("help") || (cmd.hasOption("language") && cmd.getOptions().length == 1)) {
printHelp();
}

cmd = parser.parse(this.options, args, false);

username = cmd.getOptionValue("user");
Expand Down Expand Up @@ -255,11 +255,12 @@ private Options getOptions() {

options.addOption(Option.builder("l")
.longOpt("language")
.required()
.hasArg()
.argName("en|de")
.desc(cliStrings.get("LangDescription"))
.build());

options.addOption(Option.builder("u")
.longOpt("user")
.required()
Expand Down Expand Up @@ -299,6 +300,11 @@ private Options getOptions() {
// @formatter:off
options.addOption(Option.builder("l").longOpt("language").hasArg().build());
options.addOption(Option.builder("h").longOpt("help").build());
options.addOption(Option.builder("u").longOpt("user").hasArg().argName("user").build());
options.addOption(Option.builder("p").longOpt("pass").hasArg().argName("pass").build());
options.addOption(Option.builder("e").longOpt("echo").build());
options.addOption(Option.builder("c").longOpt("cache-dir").hasArg().argName("dir").build());
options.addOption(Option.builder("o").longOpt("output").hasArg().argName("file").build());
// @formatter:on
}
return options;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
AppName=stine_calendar_bot
HelpDescription=Print this message.
LangDescription=Select the language.\n\
If not specified, your system language will be used.
LangDescription=Select the language.
Usage=Usage:
UserDescription=Username for STiNE.
PassDescription=Password for STiNE. Use -- for stdin.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
HelpDescription=Diese Nachricht anzeigen.
LangDescription=Die Sprache ausw\u00e4hlen.\n\
Wenn nicht angegeben, wird die Systemsprache ausgew\u00e4hlt.
LangDescription=Die Sprache ausw\u00e4hlen.
UserDescription=Benutzername f\u00fcr STiNE.
PassDescription=Passwort f\u00fcr STiNE. Benutze -- f\u00fcr stdin.
EchoDescription=W\u00e4hrend des Browsings alle Seiteninhalte auf stdout ausgeben.
Expand Down

0 comments on commit f604bc4

Please sign in to comment.