source/tools/jboss-v7-tool/src/main/java/com/uc4/ara/feature/utils/CmdLineParser.java
public final void parse( String[] argv, Locale locale )
            throws OptionException {

        ArrayList<Object> otherArgs = new ArrayList<Object>();
        int position = 0;
        this.values = new HashMap<String, List<?>>(10);
        while ( position < argv.length ) {
            String curArg = argv[position];
            if ( curArg.startsWith("-") ) {
                if ( curArg.equals("--") ) { // end of options
                    position += 1;
                    break;
                }
                String valueArg = null;

                int equalsPos = curArg.indexOf("=");
                if ( equalsPos != -1 ) {
                    valueArg = curArg.substring(equalsPos+1);
                    curArg = curArg.substring(0,equalsPos);
                }

                Option<?> opt = this.options.get(curArg);
                if ( opt == null ) {
                    throw new UnknownOptionException(curArg);
                }

                if ( opt.wantsValue() ) {
                    if ( valueArg == null ) {
                        position += 1;
                        if ( position < argv.length ) {
                            valueArg = argv[position];
                        }
                    }

                    addValue(opt, valueArg, locale);
                } else {
                    addValue(opt, null, locale);
                }

                position += 1;
            }
            else {
                otherArgs.add(curArg);
                position += 1;
            }
        }
        for ( ; position < argv.length; ++position ) {
            otherArgs.add(argv[position]);
        }

        this.remainingArgs = new String[otherArgs.size()];
        remainingArgs = otherArgs.toArray(remainingArgs);
    }
/**
     * Extract the options and non-option arguments from the given
     * list of command-line arguments. The specified locale is used for
     * parsing options whose values might be locale-specific.
     */
Extract the options and non-option arguments from the given
list of command-line arguments. The specified locale is used for
parsing options whose values might be locale-specific.
Extract the options and non - option arguments from the given list of command - line arguments . The specified locale is used for parsing options whose values might be locale - specific .
public final void parse( String[] argv, Locale locale )
            throws OptionException {
        ArrayList<Object> otherArgs = new ArrayList<Object>();
        int position = 0;
        this.values = new HashMap<String, List<?>>(10);
        while ( position < argv.length ) {
            String curArg = argv[position];
            if ( curArg.startsWith("-") ) {
                if ( curArg.equals("--") ) { 
                    position += 1;
                    break;
                }
                String valueArg = null;
                int equalsPos = curArg.indexOf("=");
                if ( equalsPos != -1 ) {
                    valueArg = curArg.substring(equalsPos+1);
                    curArg = curArg.substring(0,equalsPos);
                }
                Option<?> opt = this.options.get(curArg);
                if ( opt == null ) {
                    throw new UnknownOptionException(curArg);
                }
                if ( opt.wantsValue() ) {
                    if ( valueArg == null ) {
                        position += 1;
                        if ( position < argv.length ) {
                            valueArg = argv[position];
                        }
                    }
                    addValue(opt, valueArg, locale);
                } else {
                    addValue(opt, null, locale);
                }
                position += 1;
            }
            else {
                otherArgs.add(curArg);
                position += 1;
            }
        }
        for ( ; position < argv.length; ++position ) {
            otherArgs.add(argv[position]);
        }
        this.remainingArgs = new String[otherArgs.size()];
        remainingArgs = otherArgs.toArray(remainingArgs);
    }
public final void parse ( String [ ] argv , Locale locale ) throws OptionException { ArrayList < Object > otherArgs = new ArrayList < Object > ( ) ; int position = 0 ; this . values = new HashMap < String , List < ? > > ( 10 ) ; while ( position < argv . length ) { String curArg = argv [ position ] ; if ( curArg . startsWith ( "-" ) ) { if ( curArg . equals ( "--" ) ) { position += 1 ; break ; } String valueArg = null ; int equalsPos = curArg . indexOf ( "=" ) ; if ( equalsPos != - 1 ) { valueArg = curArg . substring ( equalsPos + 1 ) ; curArg = curArg . substring ( 0 , equalsPos ) ; } Option < ? > opt = this . options . get ( curArg ) ; if ( opt == null ) { throw new UnknownOptionException ( curArg ) ; } if ( opt . wantsValue ( ) ) { if ( valueArg == null ) { position += 1 ; if ( position < argv . length ) { valueArg = argv [ position ] ; } } addValue ( opt , valueArg , locale ) ; } else { addValue ( opt , null , locale ) ; } position += 1 ; } else { otherArgs . add ( curArg ) ; position += 1 ; } } for ( ; position < argv . length ; ++ position ) { otherArgs . add ( argv [ position ] ) ; } this . remainingArgs = new String [ otherArgs . size ( ) ] ; remainingArgs = otherArgs . toArray ( remainingArgs ) ; }
Extract the options and non-option arguments from the given
 list of command-line arguments.
Extract the options and non - option arguments from the given list of command - line arguments .
// end of options