Package joptsimple

Examples of joptsimple.OptionParser


         * Initializes parser
         *
         * @return OptionParser object with all available options
         */
        protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            // required options
            AdminParserUtils.acceptsHex(parser); // either --hex or
                                                 // --json
View Full Code Here


         *
         */
        @SuppressWarnings("unchecked")
        public static void executeCommand(String[] args) throws Exception {

            OptionParser parser = getParser();

            // declare parameters
            String keyType = null;
            List<String> keyStrings = null;
            String storeName = null;
            String url = null;

            // parse command-line input
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

View Full Code Here

         * Initializes parser
         *
         * @return OptionParser object with all available options
         */
        protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            // required options
            AdminParserUtils.acceptsUrl(parser);
            // optional options
View Full Code Here

         *
         */
        @SuppressWarnings("unchecked")
        public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            String url = null;
            List<Integer> nodeIds = null;
            Boolean allNodes = true;
            Boolean confirm = false;

            // parse command-line input
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

View Full Code Here

    /**
     * @param args
     */
    public static void main(String[] args) throws Exception {
        OptionParser parser = new OptionParser();
        parser.accepts("cluster-xml", "[REQUIRED] path to cluster.xml file for the server")
              .withRequiredArg()
              .describedAs("cluster-xml")
              .ofType(String.class);
        parser.accepts("src", "[REQUIRED] Source environment to be converted")
              .withRequiredArg()
              .describedAs("source-env")
              .ofType(String.class);
        parser.accepts("dest", "[REQUIRED] Destination environment to place converted data into")
              .withRequiredArg()
              .describedAs("destination-env")
              .ofType(String.class);
        parser.accepts("store", "[REQUIRED] Store/BDB database to convert")
              .withRequiredArg()
              .describedAs("store")
              .ofType(String.class);
        parser.accepts("from-format", "[REQUIRED] source format")
              .withRequiredArg()
              .describedAs("from-format")
              .ofType(String.class);
        parser.accepts("to-format", "[REQUIRED] destination format")
              .withRequiredArg()
              .describedAs("to-format")
              .ofType(String.class);
        parser.accepts("je-log-size", "[Optional] Size of the converted JE log files")
              .withRequiredArg()
              .describedAs("je-log-size")
              .ofType(Integer.class);
        parser.accepts("btree-nodemax", "[Optional] Fanout of converted Btree nodes")
              .withRequiredArg()
              .describedAs("btree-nodemax")
              .ofType(Integer.class);

        OptionSet options = parser.parse(args);

        if(!options.has("cluster-xml") || !options.has("src") || !options.has("dest")
           || !options.has("store") || !options.has("from-format") || !options.has("to-format")) {
            parser.printHelpOn(System.err);
            System.exit(0);
        }

        String clusterXmlPath = CmdUtils.valueOf(options, "cluster-xml", null);
        String sourceEnvPath = CmdUtils.valueOf(options, "src", null);
        String destEnvPath = CmdUtils.valueOf(options, "dest", null);
        String storeName = CmdUtils.valueOf(options, "store", null);

        String fromFormat = CmdUtils.valueOf(options, "from-format", null);
        String toFormat = CmdUtils.valueOf(options, "to-format", null);

        if(!isValidFormat(fromFormat) || !isValidFormat(toFormat)) {
            parser.printHelpOn(System.err);
            System.exit(0);
        }

        Integer logFileSize = CmdUtils.valueOf(options, "je-log-size", 60);
        Integer nodeMax = CmdUtils.valueOf(options, "btree-nodemax", 512);
View Full Code Here

         *
         */
        @SuppressWarnings("unchecked")
        public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            List<String> quotaTypes = null;
            List<String> storeNames = null;
            String url = null;

            // parse command-line input
            args = AdminToolUtils.copyArrayAddFirst(args, "--" + OPT_HEAD_QUOTA_GET);
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

View Full Code Here

         * Initializes parser
         *
         * @return OptionParser object with all available options
         */
        protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            // required options
            parser.accepts(OPT_HEAD_QUOTA_RESERVE_MEMORY, "memory size in MB to be reserved")
                  .withOptionalArg()
                  .describedAs("memory-size")
                  .ofType(Integer.class);
            AdminParserUtils.acceptsStoreMultiple(parser);
            AdminParserUtils.acceptsUrl(parser);
View Full Code Here

         *
         */
        @SuppressWarnings("unchecked")
        public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            long memoryMBSize = 0;
            List<String> storeNames = null;
            String url = null;
            List<Integer> nodeIds = null;
            Boolean allNodes = true;
            Boolean confirm = false;

            // parse command-line input
            args = AdminToolUtils.copyArrayAddFirst(args, "--" + OPT_HEAD_QUOTA_RESERVE_MEMORY);
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

View Full Code Here

         * Initializes parser
         *
         * @return OptionParser object with all available options
         */
        protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            // required options
            parser.accepts(OPT_HEAD_QUOTA_SET, "quota type-value pairs")
                  .withOptionalArg()
                  .describedAs("quota-type>=<quota-value")
                  .withValuesSeparatedBy(',')
                  .ofType(String.class);
            AdminParserUtils.acceptsStoreMultiple(parser);
View Full Code Here

         *
         */
        @SuppressWarnings("unchecked")
        public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            List<String> quota = null;
            List<String> storeNames = null;
            String url = null;
            Boolean confirm = false;

            // parse command-line input
            args = AdminToolUtils.copyArrayAddFirst(args, "--" + OPT_HEAD_QUOTA_SET);
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

View Full Code Here

TOP

Related Classes of joptsimple.OptionParser

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.