Package org.apache.commons.cli2.util

Examples of org.apache.commons.cli2.util.HelpFormatter


    }

  }

  private static void printHelp(Group group) {
    HelpFormatter formatter = new HelpFormatter();
    formatter.setGroup(group);
    formatter.print();
  }
View Full Code Here


    Group options = createCommandLineOptions();
    Parser parser = new Parser();
    parser.setGroup(options);

    // configure a HelpFormatter
    HelpFormatter hf = new HelpFormatter();

    // configure a parser
    Parser p = new Parser();
    p.setGroup(options);
    p.setHelpFormatter(hf);
    p.setHelpTrigger("--help");

    try {
      /**
       * PARSE THE COMMAND LINE ARGUMENTS *
       */
      CommandLine cl = parser.parseAndHelp(args);
      if (cl == null || cl.getOptions().size() == 0 || cl.hasOption("--help")) {
        hf.setGroup(options);
        hf.print();
        return;
      }

      OfflineRdfGenerator generator = new OfflineRdfGenerator(cl);

View Full Code Here

    TripleStoreUtil util = new TripleStoreUtil();
    Group options = createCommandLineOptions();
        Parser parser = new Parser();
        parser.setGroup(options);
        parser.setGroup(options);
        HelpFormatter hf = new HelpFormatter();
        parser.setHelpFormatter(hf);
        parser.setHelpTrigger("--help");
        CommandLine cl = parser.parseAndHelp(args);
        if (cl == null || cl.getOptions().size() == 0 || cl.hasOption("--help")) {
            hf.setGroup(options);
            hf.print();
            return;
        }
        String filepath = (String) cl.getValue("--filepath");
        String tripleStoreUrl = (String) cl.getValue("--triplestoreurl");
        String context = (String) cl.getValue("--context");
View Full Code Here

  public static void main(String[] args) throws IOException, KarmaException {
    Group options = createCommandLineOptions();
        Parser parser = new Parser();
        parser.setGroup(options);
        parser.setGroup(options);
        HelpFormatter hf = new HelpFormatter();
        parser.setHelpFormatter(hf);
        parser.setHelpTrigger("--help");
        CommandLine cl = parser.parseAndHelp(args);
        if (cl == null || cl.getOptions().size() == 0 || cl.hasOption("--help")) {
            hf.setGroup(options);
            hf.print();
            return;
        }
        filepath = (String) cl.getValue("--filepath");
        triplestoreURL = (String) cl.getValue("--triplestoreurl");
        context = (String) cl.getValue("--context");
View Full Code Here

  static String outputPath = null;
  public static void main(String[] args) throws IOException {
    Group options = createCommandLineOptions();
        Parser parser = new Parser();
        parser.setGroup(options);
        HelpFormatter hf = new HelpFormatter();
        parser.setHelpFormatter(hf);
        parser.setHelpTrigger("--help");
        CommandLine cl = parser.parseAndHelp(args);
        if (cl == null || cl.getOptions().size() == 0 || cl.hasOption("--help") || !cl.hasOption("--filepath")) {
            hf.setGroup(options);
            hf.print();
            return;
        }
    filePath = (String) cl.getValue("--filepath");
    outputPath = filePath;
    if (cl.hasOption("--outputpath")) {
View Full Code Here

  public static void main(String[] args) throws JSONException, KarmaException, IOException {
    Group options = createCommandLineOptions();
        Parser parser = new Parser();
        parser.setGroup(options);
        HelpFormatter hf = new HelpFormatter();
        parser.setHelpFormatter(hf);
        parser.setHelpTrigger("--help");
        CommandLine cl = parser.parseAndHelp(args);
        if (cl == null || cl.getOptions().size() == 0 || cl.hasOption("--help")) {
            hf.setGroup(options);
            hf.print();
            return;
        }
    String fileName = (String) cl.getValue("--modelpath");
    String output = (String) cl.getValue("--outputfile");
    if (fileName == null) {
View Full Code Here

    static String predicate;
  public static void main(String[] args) throws KarmaException, IOException {
    Group options = createCommandLineOptions();
        Parser parser = new Parser();
        parser.setGroup(options);
        HelpFormatter hf = new HelpFormatter();
        parser.setHelpFormatter(hf);
        parser.setHelpTrigger("--help");
        CommandLine cl = parser.parseAndHelp(args);
        if (cl == null || cl.getOptions().size() == 0 || cl.hasOption("--help")) {
            hf.setGroup(options);
            hf.print();
            return;
        }
        filepath = (String) cl.getValue("--filepath");
        triplestoreURL = (String) cl.getValue("--triplestoreurl");
        predicate = (String) cl.getValue("--predicate");
View Full Code Here

  static String outputPath = null;
  public static void main(String[] args) throws IOException {
    Group options = createCommandLineOptions();
        Parser parser = new Parser();
        parser.setGroup(options);
        HelpFormatter hf = new HelpFormatter();
        parser.setHelpFormatter(hf);
        parser.setHelpTrigger("--help");
        CommandLine cl = parser.parseAndHelp(args);
        if (cl == null || cl.getOptions().size() == 0 || cl.hasOption("--help") || !cl.hasOption("--filepath")) {
            hf.setGroup(options);
            hf.print();
            return;
        }
    filePath = (String) cl.getValue("--filepath");
    outputPath = filePath;
    useKey = Boolean.parseBoolean((String) cl.getValue("--usekey"));
View Full Code Here

 
  public static void main(String[] args) throws IOException {
    Group options = createCommandLineOptions();
        Parser parser = new Parser();
        parser.setGroup(options);
        HelpFormatter hf = new HelpFormatter();
        parser.setHelpFormatter(hf);
        parser.setHelpTrigger("--help");
        CommandLine cl = parser.parseAndHelp(args);
        if (cl == null || cl.getOptions().size() == 0 || cl.hasOption("--help") || !cl.hasOption("--filepath")) {
            hf.setGroup(options);
            hf.print();
            return;
        }
    filePath = (String) cl.getValue("--filepath");
    outputPath = filePath;
    if (cl.hasOption("--outputpath")) {
View Full Code Here

public final class CommandLineUtil {
 
  private CommandLineUtil() { }
 
  public static void printHelp(Group group) {
    HelpFormatter formatter = new HelpFormatter();
    formatter.setGroup(group);
    formatter.print();
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.cli2.util.HelpFormatter

Copyright © 2018 www.massapicom. 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.