Search in sources :

Example 16 with Option

use of org.apache.commons.cli.Option in project moco by dreamhead.

the class ShutdownPortOption method shutdownPortOption.

public static Option shutdownPortOption() {
    Option opt = new Option("s", true, "shutdown port");
    opt.setType(String.class);
    opt.setRequired(false);
    return opt;
}
Also used : Option(org.apache.commons.cli.Option)

Example 17 with Option

use of org.apache.commons.cli.Option in project moco by dreamhead.

the class StartArgsParser method httpsCertificate.

protected Option httpsCertificate() {
    Option option = new Option(null, "https", true, "Https certificate filename");
    option.setType(String.class);
    option.setRequired(false);
    return option;
}
Also used : Option(org.apache.commons.cli.Option)

Example 18 with Option

use of org.apache.commons.cli.Option in project moco by dreamhead.

the class StartArgsParser method keyStore.

protected Option keyStore() {
    Option option = new Option(null, "keystore", true, "Key store password");
    option.setType(String.class);
    option.setRequired(false);
    return option;
}
Also used : Option(org.apache.commons.cli.Option)

Example 19 with Option

use of org.apache.commons.cli.Option in project moco by dreamhead.

the class StartArgsParser method settingsOption.

protected Option settingsOption() {
    Option opt = new Option("g", true, "global settings");
    opt.setType(String.class);
    opt.setRequired(false);
    return opt;
}
Also used : Option(org.apache.commons.cli.Option)

Example 20 with Option

use of org.apache.commons.cli.Option in project onebusaway-gtfs-modules by OneBusAway.

the class GtfsDatabaseLoaderMain method buildOptions.

protected void buildOptions(Options options) {
    Option driverClassOption = new Option(ARG_DRIVER_CLASS, true, "JDBC driverClass");
    driverClassOption.setRequired(true);
    options.addOption(driverClassOption);
    Option urlOption = new Option(ARG_URL, true, "JDBC url");
    urlOption.setRequired(true);
    options.addOption(urlOption);
    options.addOption(ARG_USERNAME, true, "JDBC username");
    options.addOption(ARG_PASSWORD, true, "JDBC password");
}
Also used : Option(org.apache.commons.cli.Option)

Aggregations

Option (org.apache.commons.cli.Option)152 Options (org.apache.commons.cli.Options)105 CommandLine (org.apache.commons.cli.CommandLine)53 CommandLineParser (org.apache.commons.cli.CommandLineParser)52 ParseException (org.apache.commons.cli.ParseException)41 GnuParser (org.apache.commons.cli.GnuParser)39 HelpFormatter (org.apache.commons.cli.HelpFormatter)30 File (java.io.File)13 OptionGroup (org.apache.commons.cli.OptionGroup)13 FileInputStream (java.io.FileInputStream)10 IOException (java.io.IOException)10 HashMap (java.util.HashMap)9 DefaultParser (org.apache.commons.cli.DefaultParser)9 Properties (java.util.Properties)8 BasicParser (org.apache.commons.cli.BasicParser)6 ConsoleAppender (org.apache.log4j.ConsoleAppender)6 PatternLayout (org.apache.log4j.PatternLayout)6 ArrayList (java.util.ArrayList)5 PosixParser (org.apache.commons.cli.PosixParser)5 List (java.util.List)3