add dest and cwd support