@Parameters(index = "1..*") public void setOtherFiles(List<File> otherFiles) { for (File f : otherFiles) { if (!f.exists()) { throw new ParameterException(spec.commandLine(), "File " + f.getAbsolutePath() + " must exist"); } } this.otherFiles = otherFiles; }
Builder(Parameters parameters, IAnnotatedElement source, IFactory factory) { this(source); arity = Range.parameterArity(source); required = arity.min > 0; // method parameters may be positional parameters without @Parameters annotation if (parameters == null) { paramLabel = inferLabel(null, source.getName(), source.getTypeInfo()); } else { paramLabel = inferLabel(parameters.paramLabel(), source.getName(), source.getTypeInfo()); hideParamSyntax = parameters.hideParamSyntax(); interactive = parameters.interactive(); description = parameters.description(); descriptionKey = parameters.descriptionKey(); splitRegex = parameters.split(); hidden = parameters.hidden(); defaultValue = parameters.defaultValue(); showDefaultValue = parameters.showDefaultValue(); if (factory != null) { // annotation processors will pass a null factory converters = DefaultFactory.createConverter(factory, parameters.converter()); if (!NoCompletionCandidates.class.equals(parameters.completionCandidates())) { completionCandidates = DefaultFactory.createCompletionCandidates(factory, parameters.completionCandidates()); } } } } private static String inferLabel(String label, String fieldName, ITypeInfo typeInfo) {
sortOptions = false) public class CsvResultMerger { @Parameters(index = "0..*", paramLabel="<FILES>", description = "The paths to the tmp result files.") private static String[] resultFiles = {}; @Option(names = {"-p", "--publisher-extractor"}, paramLabel="<REGEX>", description =
@Parameters(arity = "1..*", description = "One or more source files to verify") private List<File> files;
String output = "target"; @Parameters(description = "one or more tests (features) or search-paths to run") List<String> tests;
public class SpaceRunCommand extends AbstractRunCommand { @Parameters(index = "0", description = "Name of Space to run") public String name; @Option(names = {"--partitions"}, description = "Specify the number of partitions for the Processing Unit")
@Parameters(index = "0", description = "The file to execute can be a .jar or .java file") private String binary; @Parameters(index = "1..*", description = "Parameters that are passed to function", paramLabel = "param=value") private Map<String, String> parameters;
public class GraphImporter implements Callable<Void> { @Parameters(index = "0", description = "List of Kafka servers.") private String bootstrapServers; @Parameters(index = "1", description = "The vertices file.") private File verticesFile; @Parameters(index = "2", description = "The edges file.") private File edgesFile; @Parameters(index = "3", description = "The vertices topic.") private String verticesTopic; @Parameters(index = "4", description = "The edges topic.") private String edgesTopic;
public class RetroactiveStatisticalTests { @Parameters(index = "0", paramLabel="<FOLDER>", description = "The folder where the statistical evaluation output file were saved to.") private static String folder = "stats/";
List<String> message = new ArrayList<String>(); @Parameters(paramLabel = "<files>", description = "the files to commit") List<File> files = new ArrayList<File>();
private boolean helpRequested; @Parameters(paramLabel = "COMMAND", descriptionKey = "helpCommand.command", description = "The COMMAND to display the usage help message for.") private String[] commands = new String[0];
public class PuRunCommand extends AbstractRunCommand { @Parameters(index = "0", description = "Relative/absolute path of a Processing Unit directory or archive file") File path; @Option(names = {"--partitions" }, description = "Specify the number of partitions for the Processing Unit")
class CheckSum implements Callable<Void> { @Parameters(index = "0", description = "The file whose checksum to calculate.") private File file;
@Parameters(index = "0", paramLabel = "<job name or id>", description = "Name of the job to terminate") String jobName, @Parameters(index = "1", paramLabel = "<snapshot name>", description = "Name of the snapshot")
@Command( name = "modman", abbreviateSynopsis = true, sortOptions = false, description = "Perform actions against an FTL installation and/or a list of named mods.", footer = "%nIf a named mod is a directory, a temporary zip will be created.", versionProvider = SlipstreamVersionProvider.class ) public static class SlipstreamCommand { @Option(names = "--extract-dats", paramLabel = "DIR", description = "extract FTL resources into a dir") File extractDatsDir; @Option(names = "--global-panic", description = "patch as if advanced find tags had panic='true'") boolean globalPanic; @Option(names = "--list-mods", description = "list available mod names") boolean listMods; @Option(names = "--runftl", description = "run the game (standalone or with 'patch')") boolean runftl; @Option(names = "--patch", description = "revert to vanilla and add named mods (if any)") boolean patch; @Option(names = "--validate", description = "check named mods for problems") boolean validate; @Option(names = {"-h", "--help"}, usageHelp = true, description = "display this help and exit") boolean helpRequested; @Option(names = "--version", versionHelp = true, description = "output version information and exit") boolean versionRequested; @Parameters(paramLabel = "MODFILE", description = "names of files or directories in the mods/ dir") String[] modFileNames; }
@Command(description = "Submits a job to the cluster", mixinStandardHelpOptions = true ) public void submit( @Option(names = {"-s", "--snapshot"}, paramLabel = "<snapshot name>", description = "Name of initial snapshot to start the job from" ) String snapshotName, @Option(names = {"-n", "--name"}, paramLabel = "<name>", description = "Name of the job" ) String name, @Parameters(index = "0", paramLabel = "<jar file>", description = "The jar file to submit" ) File file, @Parameters(index = "1..*", paramLabel = "<arguments>", description = "arguments to pass to the supplied jar file", defaultValue = "" ) List<String> params ) throws Exception { if (!file.exists()) { throw new Exception("File " + file + " could not be found."); } printf("Submitting JAR '%s' with arguments %s%n", file, params); JetBootstrap.executeJar(getClientConfig(), file.getAbsolutePath(), snapshotName, name, params); }
@Parameters(arity = "1..1", description = "The password input") private String password = null;
@Command(name = "i18n-sub", subcommands = CommandLine.HelpCommand.class, mixinStandardHelpOptions = true, description = {"subcmd desc 1", "subcmd desc 2", "subcmd desc 3"}, descriptionHeading = "subcmd desc heading%n", header = {"subcmd header 1", "subcmd header 2", "subcmd header 3"}, headerHeading = "subcmd header heading%n", footer = {"subcmd footer 1", "subcmd footer 2", "subcmd footer 3"}, footerHeading = "subcmd footer heading%n", commandListHeading = "subcmd command list heading%n", optionListHeading = "subcmd option list heading%n", parameterListHeading = "subcmd param list heading%n") public class I18nSubcommand { @Option(names = {"-x", "--xxx"}) String x; @Option(names = {"-y", "--yyy"}, description = {"subcmd yyy description 1", "subcmd yyy description 2"}) String y; @Option(names = {"-z", "--zzz"}, description = "subcmd zzz description") String z; @Parameters(index = "0") String param0; @Parameters(index = "1", description = "subcmd param1 description") String param1; }
@Command(name = "i18n", resourceBundle = "picocli.I18nSuperclass_Messages", subcommands = CommandLine.HelpCommand.class, mixinStandardHelpOptions = true, description = {"super desc 1", "super desc 2", "super desc 3"}, descriptionHeading = "super desc heading%n", header = {"super header 1", "super header 2", "super header 3"}, headerHeading = "super header heading%n", footer = {"super footer 1", "super footer 2", "super footer 3"}, footerHeading = "super footer heading%n", commandListHeading = "super command list heading%n", optionListHeading = "super option list heading%n", parameterListHeading = "super param list heading%n") public class I18nSuperclass { @Option(names = {"-x", "--xxx"}) String x; @Option(names = {"-y", "--yyy"}, description = {"super yyy description 1", "super yyy description 2"}) String y; @Option(names = {"-z", "--zzz"}, description = "super zzz description") String z; @Parameters(index = "0") String param0; @Parameters(index = "1", description = "super param1 description") String param1; }
@Command(name = "i18n-top", resourceBundle = "picocli.SharedMessages", subcommands = {CommandLine.HelpCommand.class, I18nSubcommand.class }, mixinStandardHelpOptions = true, description = {"top desc 1", "top desc 2", "top desc 3"}, descriptionHeading = "top desc heading%n", header = {"top header 1", "top header 2", "top header 3"}, headerHeading = "top header heading%n", footer = {"top footer 1", "top footer 2", "top footer 3"}, footerHeading = "top footer heading%n", commandListHeading = "top command list heading%n", optionListHeading = "top option list heading%n", parameterListHeading = "top param list heading%n") public class I18nCommand { @Option(names = {"-x", "--xxx"}) String x; @Option(names = {"-y", "--yyy"}, description = {"top yyy description 1", "top yyy description 2"}) String y; @Option(names = {"-z", "--zzz"}, description = "top zzz description") String z; @Parameters(index = "0") String param0; @Parameters(index = "1", description = "top param1 description") String param1; }