Update path & pattern tests

This commit is contained in:
RatzzFatzz
2024-11-24 23:57:24 +01:00
parent b638d93358
commit 47b4cdc896
5 changed files with 136 additions and 130 deletions

View File

@@ -32,9 +32,13 @@ public class Config {
private File configPath;
@CommandLine.Spec
CommandLine.Model.CommandSpec spec;
@CommandLine.Option(names = {"-a", "--attribute-config"}, required = true, arity = "1..*", converter = AttributeConfigConverter.class)
private List<AttributeConfig> attributeConfig;
@CommandLine.Option(names = {"-l", "--library"}, required = true, description = "path to library")
@Setter(AccessLevel.NONE)
private File libraryPath;
@CommandLine.Option(names = {"-s", "--safemode"}, description = "test run (no files will be changes)")
@@ -74,6 +78,12 @@ public class Config {
private Set<String> preferredSubtitles = new HashSet<>(Arrays.asList("unstyled"));
@CommandLine.Option(names = {"-l", "--library"}, required = true, description = "path to library")
public void setLibraryPath(File libraryPath) {
this.libraryPath = libraryPath;
if (!libraryPath.exists()) throw new CommandLine.ParameterException(spec.commandLine(), "Path does not exist: " + libraryPath.getAbsolutePath());
}
public static Config getInstance() {
return getInstance(false);
}