Implement new '--output-dir' option.