Fix CR comments & remove OS Validator

This commit is contained in:
2023-02-19 16:52:27 +01:00
parent ce9a2fc805
commit fe30d186df
7 changed files with 9 additions and 83 deletions

View File

@@ -18,12 +18,11 @@ import static at.pcgamingfreaks.mkvaudiosubtitlechanger.util.CommandLineOptionsU
public class ConfigLoader {
private static final List<ConfigValidator<?>> VALIDATORS = List.of(
new ConfigPathValidator(CONFIG_PATH, false, Path.of("./config.yaml").toFile()),
new ConfigPathValidator(CONFIG_PATH, true, Path.of("./config.yaml").toFile()),
new PathValidator(LIBRARY, true, null),
new ThreadValidator(THREADS, false, 2),
new MkvToolNixPathValidator(MKV_TOOL_NIX, true, Path.of("C:\\Program Files\\MKVToolNix").toFile()),
new BooleanValidator(SAFE_MODE, false),
new OperatingSystemValidator(WINDOWS),
new PatternValidator(INCLUDE_PATTERN, false, Pattern.compile(".*")),
new SetValidator(FORCED_KEYWORDS, false, true),
new SetValidator(COMMENTARY_KEYWORDS, false, true),
@@ -104,13 +103,4 @@ public class ConfigLoader {
System.exit(0);
}
}
private static File loadConfigPath(CommandLine cmd) {
File configPath = new File(cmd.getOptionValue(CONFIG_PATH.prop(), "config.yaml"));
if (configPath.isFile()) return configPath;
System.out.println("invalid config path");
System.exit(1);
return null;
}
}