mirror of
https://github.com/Febbweiss/scrabble-resolver.git
synced 2026-03-04 14:15:37 +00:00
Fix: right way to manage enigma resolution
This commit is contained in:
@@ -38,7 +38,6 @@ public class Main {
|
||||
|
||||
try {
|
||||
CommandLine line = parser.parse(options, args);
|
||||
System.out.println(line.getArgList());
|
||||
if( line.hasOption( "build" ) ) {
|
||||
generate(line);
|
||||
} else {
|
||||
@@ -83,8 +82,8 @@ public class Main {
|
||||
final int min = Integer.parseInt(line.getOptionValue("min", "3"));
|
||||
final int max = Integer.parseInt(line.getOptionValue("max", "7"));
|
||||
char[] letters = null;
|
||||
if( line.getArgList().size() == 1 ) {
|
||||
letters = line.getArgList().get(0).toCharArray();
|
||||
if( line.hasOption("resolve") ) {
|
||||
letters = line.getOptionValue("resolve").toCharArray();
|
||||
}
|
||||
try {
|
||||
manageLanguage(language);
|
||||
@@ -144,12 +143,21 @@ public class Main {
|
||||
.argName("max")
|
||||
.required(false)
|
||||
.build();
|
||||
|
||||
final Option lettersOption = Option.builder("r")
|
||||
.longOpt("resolve")
|
||||
.desc("Find words with the given letters")
|
||||
.hasArg(true)
|
||||
.argName("letters")
|
||||
.required(false)
|
||||
.build();
|
||||
|
||||
final Options options = new Options();
|
||||
|
||||
options.addOption(buildOption);
|
||||
options.addOption(helpFileOption);
|
||||
options.addOption(languageOption);
|
||||
options.addOption(lettersOption);
|
||||
options.addOption(minOption);
|
||||
options.addOption(maxOption);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user