Separating --delete as a subcommand and adding resource type filtering

we could move this to the end of the function, and delete the files only if all the other parsing succeeds