Package org.rhq.enterprise.client.script

Examples of org.rhq.enterprise.client.script.CommandLineParseException


        int code = getopt.getopt();
        while (code != -1) {
            switch (code) {
                case ':':
                case '?':
                   throw new CommandLineParseException("Invalid option");
                case 1:
                    break;
                case 'f':
                    recordArgs.file = new File(getopt.getOptarg());
                    break;
                case 'a':
                    recordArgs.append = true;
                    break;
                case 'b':
                    if (recordArgs.recordState == null) {
                        recordArgs.recordState = RecordState.START;
                    }
                    break;
                case 'e':
                    if (recordArgs.recordState == null) {
                        recordArgs.recordState = RecordState.STOP;
                    }
                    break;
            }
            code = getopt.getopt();
        }

        if (recordArgs.file == null) {
            throw new CommandLineParseException("The file option must be specified.");
        }

        if (recordArgs.recordState == null) {
            throw new CommandLineParseException("Either the start or stop option must be specified.");
        }

        return recordArgs;
    }
View Full Code Here


        int code = getopt.getopt();
        while (code != -1) {
            switch (code) {
                case ':':
                    throw new CommandLineParseException("Invalid option");
                case 'v':
                    versionArgs.verbose = true;
                    break;
            }
            code = getopt.getopt();
View Full Code Here

    }

    @Override
    public boolean execute(ClientMain client, String[] args) {
        if (args.length < 3) {
            throw new CommandLineParseException("Too few arguments");
        }
        if (args.length > 7) {
            throw new CommandLineParseException("Too many arguments");
        }

        String user = args[1];
        String pass = args[2];
        String host = "localhost";
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.client.script.CommandLineParseException

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.