Examples of HelpFormatter


Examples of org.apache.commons.cli.HelpFormatter

    return _pluginList;
  }
 
  void printHelp()
  {
    HelpFormatter formatter = new HelpFormatter();
    formatter.printHelp("squirrel-sql", _options);
  }
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

            printHelp(out, options);
        }
    }

    private static void printHelp(PrintStream out, Options options) {
        HelpFormatter formatter = new HelpFormatter();
        PrintWriter pw = new PrintWriter(out);

        formatter.printHelp(
            pw,
            80,
            "groovy [options] [args]",
            "options:",
            options,
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

      CommandLineParser parser = new GnuParser();
      CommandLine line=null;
      try{
        line = parser.parse(options, args);
      } catch(Exception e){
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp("cronconverter", options, true);
        System.exit(0);
      }
     
      sourceFile = getWholeArgument(line.getOptionValues("crontab"));
      if (sourceFile.equalsIgnoreCase("/etc/crontab")) sysTab = true;
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

* </ul>
*/
public class Main implements Constants {

  private static void printUsageAndExit(Options options, int exitCode) {
    HelpFormatter formatter = new HelpFormatter();
    formatter.printHelp("bin/hbase rest start", "", options,
      "\nTo run the REST server as a daemon, execute " +
      "bin/hbase-daemon.sh start|stop rest [--infoport <port>] [-p <port>] [-ro]\n", true);
    System.exit(exitCode);
  }
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

    this.conf = HBaseConfiguration.create(conf);
  }

  private static void printUsageAndExit(Options options, int exitCode)
      throws ExitCodeException {
    HelpFormatter formatter = new HelpFormatter();
    formatter.printHelp("Thrift", null, options,
        "To start the Thrift server run 'bin/hbase-daemon.sh start thrift'\n" +
        "To shutdown the thrift server run 'bin/hbase-daemon.sh stop " +
        "thrift' or send a kill signal to the thrift server pid",
        true);
    throw new ExitCodeException(exitCode, "");
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

    CommandLineParser parser = new GnuParser();
    CommandLine commandLine = parser.parse(options, args);

    if (commandLine.hasOption('h')) {
      new HelpFormatter().printHelp("flume-ng avro-client", "", options,
          "The --dirname option assumes that a spooling directory exists " +
          "where immutable log files are dropped.", true);

      return false;
    }
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

        }
      } catch( ParseException exp ) {
          // oops, something went wrong
          System.err.println( "Parsing failed.  Reason: " + exp.getMessage() );
         
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp( "list", options );
      }       
    }
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

            }
        }
        File file = new File(command.getOptionValue("file", defaultFile));

        if (command.hasOption("help")) {
            HelpFormatter formatter = new HelpFormatter();
            formatter.printHelp("java -jar " + file.getName(), options, true);
        } else if (command.hasOption("notice")) {
            copyToOutput("/META-INF/NOTICE.txt");
        } else if (command.hasOption("license")) {
            copyToOutput("/META-INF/LICENSE.txt");
        } else if (command.hasOption("cli")) {
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

      options.addOption("f", "file", true,
        "File to scan. Pass full-path; e.g. hdfs://a:9000/hbase/.META./12/34");
      options.addOption("r", "region", true,
        "Region to scan. Pass region name; e.g. '.META.,,1'");
      if (args.length == 0) {
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp("HFile ", options, true);
        System.exit(-1);
      }
      CommandLineParser parser = new PosixParser();
      CommandLine cmd = parser.parse(options, args);
      boolean verbose = cmd.hasOption("v");
View Full Code Here

Examples of org.apache.commons.cli.HelpFormatter

    public Cli()
    {
      _usage = "java " + NAME + " [options]";
      _cliOptions = new Options();
      constructCommandLineOptions();
      _helpFormatter = new HelpFormatter();
      _helpFormatter.setWidth(150);
    }
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.