Examples of JCommander


Examples of com.beust.jcommander.JCommander

        argumentsList.add(0, "start");
        arguments = argumentsList.toArray(new String[argumentsList.size()]);
      }
    }

    JCommander commander = new JCommander();
    ObfuscateOptions obfuscateOptions = new ObfuscateOptions();
    commander.addCommand("obfuscate", obfuscateOptions);

    StartOptions startOptions = new StartOptions();
    commander.addCommand("start", startOptions);

    StopOptions stopOptions = new StopOptions();
    commander.addCommand("stop", stopOptions);

    CheckConfigOptions checkConfigOptions = new CheckConfigOptions();
    commander.addCommand("checkConfig", checkConfigOptions);

    commander.parse(arguments);

    switch (commander.getParsedCommand()) {
    case "start":
      startTc(startOptions);
      break;
    case "stop":
      stopTc(stopOptions);
      break;
    case "obfuscate":
      ObfuscateUtil.obfuscate(obfuscateOptions);
      break;
    case "checkConfig":
      CheckConfig.check(checkConfigOptions);
      break;
    default:
      commander.usage();
      break;
    }

  }
View Full Code Here

Examples of com.beust.jcommander.JCommander

public class Main
{
    public static void main(final String ... args) throws Exception
    {
        Swift2ThriftGeneratorCommandLineConfig cliConfig = new Swift2ThriftGeneratorCommandLineConfig();
        JCommander jCommander = new JCommander(cliConfig, args);
        jCommander.setProgramName(Swift2ThriftGenerator.class.getSimpleName());

        if (cliConfig.inputFiles == null) {
            jCommander.usage();
            return;
        }

        ImmutableMap.Builder<String, String> mapBuilder = ImmutableMap.builder();
        if (cliConfig.includeMap != null) {
View Full Code Here

Examples of com.beust.jcommander.JCommander

        }
    }

    private static ScrutineerCommandLineOptions parseOptions(String[] args) {
        ScrutineerCommandLineOptions options = new ScrutineerCommandLineOptions();
        new JCommander(options, args);
        return options;
    }
View Full Code Here

Examples of com.beust.jcommander.JCommander

import java.util.jar.JarFile;

public class DecompilerDriver {
    public static void main(final String[] args) {
        final CommandLineOptions options = new CommandLineOptions();
        final JCommander jCommander;
        final List<String> typeNames;

        try {
            jCommander = new JCommander(options);
            jCommander.setAllowAbbreviatedOptions(true);
            jCommander.parse(args);
            typeNames = options.getClassNames();
        }
        catch (Throwable t) {
            System.err.println(ExceptionUtilities.getMessage(t));
            System.exit(-1);
            return;
        }

        final String jarFile = options.getJarFile();
        final boolean decompileJar = !StringUtilities.isNullOrWhitespace(jarFile);

        if (options.getPrintUsage() ||
            typeNames.isEmpty() && !decompileJar) {

            jCommander.usage();
            return;
        }

        final DecompilerSettings settings = new DecompilerSettings();
View Full Code Here

Examples of com.beust.jcommander.JCommander

      ls.setVisible(true);
      build = Util.getBuild();
    }
    Options options = new Options();
    try {
      new JCommander(options, args);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    MinecraftUtils.setOptions(options);
    recursion = new File(PlatformUtils.getWorkingDirectory(), "rtemp");
View Full Code Here

Examples of com.beust.jcommander.JCommander

        argumentsList.add(0, "start");
        arguments = argumentsList.toArray(new String[argumentsList.size()]);
      }
    }

    JCommander commander = new JCommander();
    ObfuscateOptions obfuscateOptions = new ObfuscateOptions();
    commander.addCommand("obfuscate", obfuscateOptions);

    StartOptions startOptions = new StartOptions();
    commander.addCommand("start", startOptions);

    StopOptions stopOptions = new StopOptions();
    commander.addCommand("stop", stopOptions);

    CheckConfigOptions checkConfigOptions = new CheckConfigOptions();
    commander.addCommand("checkConfig", checkConfigOptions);

    commander.parse(arguments);

    switch (commander.getParsedCommand()) {
    case "start":
      startTc(startOptions);
      break;
    case "stop":
      stopTc(stopOptions);
      break;
    case "obfuscate":
      ObfuscateUtil.obfuscate(obfuscateOptions);
      break;
    case "checkConfig":
      CheckConfig.check(checkConfigOptions);
      break;
    default:
      commander.usage();
      break;
    }

  }
View Full Code Here

Examples of com.beust.jcommander.JCommander

    public static void main(final String ... args) throws Exception
    {
        URI workingDirectory = new File(System.getProperty("user.dir")).getCanonicalFile().toURI();

        SwiftGeneratorCommandLineConfig cliConfig = new SwiftGeneratorCommandLineConfig();
        JCommander jCommander = new JCommander(cliConfig, args);
        jCommander.setProgramName(SwiftGenerator.class.getSimpleName());

        if (cliConfig.inputFiles == null) {
            jCommander.usage();
            return;
        }

        SwiftGeneratorConfig.Builder configBuilder = SwiftGeneratorConfig.builder()
                .inputBase(workingDirectory)
View Full Code Here

Examples of com.beust.jcommander.JCommander

public class Main
{
    public static void main(final String ... args) throws Exception
    {
        Swift2ThriftGeneratorCommandLineConfig cliConfig = new Swift2ThriftGeneratorCommandLineConfig();
        JCommander jCommander = new JCommander(cliConfig, args);
        jCommander.setProgramName(Swift2ThriftGenerator.class.getSimpleName());

        if (cliConfig.inputFiles == null) {
            jCommander.usage();
            return;
        }

        ImmutableMap.Builder<String, String> mapBuilder = ImmutableMap.builder();
        if (cliConfig.includeMap != null) {
View Full Code Here

Examples of com.beust.jcommander.JCommander

  }

  public static StartupOptions parse(String[] cliArgs) {
    logger.debug("Parsing arguments.");
    StartupOptions args = new StartupOptions();
    JCommander jc = new JCommander(args, cliArgs);
    if(args.help){
      jc.usage();
      System.exit(0);
    }
    return args;
  }
View Full Code Here

Examples of com.beust.jcommander.JCommander

  public static void main(String args[]) throws Exception {
    DumpCat dumpCat = new DumpCat();

    Options o = new Options();
    JCommander jc = null;
    try {
      jc = new JCommander(o, args);
      jc.setProgramName("./drill_dumpcat");
    } catch (ParameterException e) {
      System.out.println(e.getMessage());
      String[] valid = {"-f", "file"};
      new JCommander(o, valid).usage();
      System.exit(-1);
    }
    if (o.help) {
      jc.usage();
      System.exit(0);
    }

    /*Check if dump file exists*/
    File file = new File(o.location);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.