give the `env` flag type `[String]`, improve code (fixes #748)