public String[] parse(String[] argv){

        Option opt;
        StrOption stropt;
        BoolOption boolopt;
        ArrayList<String> rest = new ArrayList<String>();

        for(int i = 0; i < argv.length; i++){

            if(cache.containsKey(argv[i])){

                opt = cache.get(argv[i]);

                if(opt instanceof BoolOption){

                    boolopt = (BoolOption) opt;
                    boolopt.found();

                }else if(opt instanceof StrOption) {

                    if( i+1 >= argv.length){
                        String errmsg = "Missing argument for: %s" ;
                        errmsg = String.format(errmsg, argv[i]);
                        if(! dieOnError){
                            throw new Error(errmsg);
                        }else{
                            System.err.printf("%s\n", errmsg);
                            System.exit(1);
                        }
                    }

                    stropt = (StrOption) opt;
                    stropt.add(argv[++i]);
                }

            }else{ // not plain options 

                if( ! juxtaBool( argv[i] ) && ! juxtaStr(argv[i]) ){
                    rest.add( argv[i] );
                }
            }
        }

        String[] tmp = new String[rest.size()];
        return rest.toArray(tmp);
    }