command: allow autoexecuting commands on writes

Useful for updating a document viewer or performing custom actions.