use argv for query and target dir.