001package com.github.sormuras.bach.command;
002
003import java.nio.file.Path;
004import java.util.ArrayList;
005import java.util.List;
006
007/** An option collecting paths specifying where to find application modules. */
008public record ModulePathsOption(List<Path> values) implements Option.Values<Path> {
009  public static ModulePathsOption empty() {
010    return new ModulePathsOption(List.of());
011  }
012
013  public ModulePathsOption add(Path path, Path... more) {
014    var values = new ArrayList<>(this.values);
015    values.add(path);
016    if (more.length > 0) values.addAll(List.of(more));
017    return new ModulePathsOption(values);
018  }
019}