added --output-dir option