public static String[] processOptions(Context cx, String args[]) {
        for (int i=0; i < args.length; i++) {
            String arg = args[i];
            if (!arg.startsWith("-")) {
                String[] result = new String[args.length - i];
                for (int j=i; j < args.length; j++)
                    result[j-i] = args[j];
                return result;
            }
            if (arg.equals("-version")) {
                if (++i == args.length)
                    usage(arg);
                double d = Context.toNumber(args[i]);
                if (d != d)
                    usage(arg);
                cx.setLanguageVersion((int) d);
                continue;
            }
            usage(arg);
        }
        return new String[0];
    }
public static String [ ] processOptions ( Context cx , String args [ ] ) { for ( int i = 0 ; i < args . length ; i ++ ) { String arg = args [ i ] ; if ( ! arg . startsWith ( "-" ) ) { String [ ] result = new String [ args . length - i ] ; for ( int j = i ; j < args . length ; j ++ ) result [ j - i ] = args [ j ] ; return result ; } if ( arg . equals ( "-version" ) ) { if ( ++ i == args . length ) usage ( arg ) ; double d = Context . toNumber ( args [ i ] ) ; if ( d != d ) usage ( arg ) ; cx . setLanguageVersion ( ( int ) d ) ; continue ; } usage ( arg ) ; } return new String [ 0 ] ; }
Parse arguments.