Search in sources :

Example 1 with Command

use of com.evolveum.midpoint.ninja.impl.Command in project midpoint by Evolveum.

the class NinjaUtils method setupCommandLineParser.

public static JCommander setupCommandLineParser() {
    BaseOptions base = new BaseOptions();
    ConnectionOptions connection = new ConnectionOptions();
    JCommander.Builder builder = JCommander.newBuilder().expandAtSign(false).addObject(base).addObject(connection);
    for (Command cmd : Command.values()) {
        builder.addCommand(cmd.getCommandName(), cmd.createOptions());
    }
    JCommander jc = builder.build();
    jc.setProgramName("java [-Dloader.path=<jdbc_driver_jar_path>] -jar ninja.jar");
    jc.setColumnSize(110);
    jc.setAtFileCharset(Charset.forName(base.getCharset()));
    return jc;
}
Also used : BaseOptions(com.evolveum.midpoint.ninja.opts.BaseOptions) Command(com.evolveum.midpoint.ninja.impl.Command) JCommander(com.beust.jcommander.JCommander) ConnectionOptions(com.evolveum.midpoint.ninja.opts.ConnectionOptions)

Aggregations

JCommander (com.beust.jcommander.JCommander)1 Command (com.evolveum.midpoint.ninja.impl.Command)1 BaseOptions (com.evolveum.midpoint.ninja.opts.BaseOptions)1 ConnectionOptions (com.evolveum.midpoint.ninja.opts.ConnectionOptions)1