Document the `env` arg for cmdmod functions, Fix #5772