Add optional --delete flag to copy-dir

This commit adds an optional `--delete` flag to `copy-dir` (it's an option to prevent accidental data deletion).

The option parsing code is based on a [Bash FAQ example](http://mywiki.wooledge.org/BashFAQ/035).