Support optional argument for output directory.