
if(arguments!=null && arguments.length>0) {
    var input = 0;
    var output = 0;
    if("name".equals(arguments[0])) input = 0;
    else if("host".equals(arguments[0])) input = 1;
    else if("driver".equals(arguments[0])) input = 2;
    else if("location".equals(arguments[0])) input = 3;
    if("name".equals(arguments[2])) output = 0;
    else if("host".equals(arguments[2])) output = 1;
    else if("driver".equals(arguments[2])) output = 2;
    else if("ifhp_driver".equals(arguments[2])) output = 2;
    else if("location".equals(arguments[2])) output = 3;

    for(var i=0; i<printers.length; i++) {
        if(arguments[1]!=printers[i][input]) continue;
	if("ifhp_driver".equals(arguments[2])) {
            for(var j=0; j<ifhpDrivers.length; j++) {
                var re = new RegExp(ifhpDrivers[j][0]);
                if(!re.test(printers[i][output])) continue;
                print(ifhpDrivers[j][1]);
                break;
            }
	}
        else print(printers[i][output]);
        break;
    }
}
