Repository: docker/compose-cli
Pull request #805 (2020-10-16 16:07:59)

Replace `docker run —envFile` with `docker run —env-file`
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>

**What I did**
is all in the title

**Related issue**
https://github.com/docker/compose-cli/issues/802

<!-- optional tests
You can add a / mention to run tests executed by default only on main branch : 
* `test-aci` to run ACI E2E tests
* `test-ecs` to run ECS E2E tests
* `test-windows` to run tests & E2E tests on windows
-->

**(not mandatory) A picture of a cute animal, if possible in relation with what you did**
![](https://lists.hi7.co/lists/lists-56d13653c4543.jpg)


Patch:
diff --git a/cli/cmd/run/run.go b/cli/cmd/run/run.go
index e1088475..24f415ce 100644
--- a/cli/cmd/run/run.go
+++ b/cli/cmd/run/run.go
@@ -56,7 +56,7 @@ func Command(contextType string) *cobra.Command {
 	cmd.Flags().Float64Var(&opts.Cpus, "cpus", 1., "Number of CPUs")
 	cmd.Flags().VarP(&opts.Memory, "memory", "m", "Memory limit")
 	cmd.Flags().StringArrayVarP(&opts.Environment, "env", "e", []string{}, "Set environment variables")
-	cmd.Flags().StringArrayVar(&opts.EnvironmentFiles, "envFile", []string{}, "Path to environment files to be translated as environment variables")
+	cmd.Flags().StringArrayVar(&opts.EnvironmentFiles, "env-file", []string{}, "Path to environment files to be translated as environment variables")
 	cmd.Flags().StringVarP(&opts.RestartPolicyCondition, "restart", "", containers.RestartPolicyNone, "Restart policy to apply when a container exits")
 
 	if contextType == store.AciContextType {
diff --git a/docs/aci-container-features.md b/docs/aci-container-features.md
index 3f568861..5d8927b8 100644
--- a/docs/aci-container-features.md
+++ b/docs/aci-container-features.md
@@ -21,7 +21,7 @@ __Legend:__
 | -d, --detach          | ✓ | Detach from container logs when container starts. By default, the command line stays attached and follow container logs.
 | --domainname          | ✓ | See [Exposing ports](#exposing-ports).
 | --e, --env            | ✓ | Sets environment variable.
-| --envFile             | ✓ | Sets environment variable from and external file.
+| --env-file            | ✓ | Sets environment variable from and external file.
 | -l, --label           | x | Unsupported in Docker ACI integration, due to limitations of ACI Tags.
 | -m, --memory          | ✓ | See [Container Resources](#container-resources).
 | --name                | ✓ | Provide a name for the container. Name must be unique withing the ACI resource group. a name is generated by default.


Test patch:
diff --git a/cli/cmd/run/testdata/run-help.golden b/cli/cmd/run/testdata/run-help.golden
index 71692ccd..642976fd 100644
--- a/cli/cmd/run/testdata/run-help.golden
+++ b/cli/cmd/run/testdata/run-help.golden
@@ -4,14 +4,14 @@ Usage:
   run [flags]
 
 Flags:
-      --cpus float            Number of CPUs (default 1)
-  -d, --detach                Run container in background and print container ID
-      --domainname string     Container NIS domain name
-  -e, --env stringArray       Set environment variables
-      --envFile stringArray   Path to environment files to be translated as environment variables
-  -l, --label stringArray     Set meta data on a container
-  -m, --memory bytes          Memory limit
-      --name string           Assign a name to the container
-  -p, --publish stringArray   Publish a container's port(s). [HOST_PORT:]CONTAINER_PORT
-      --restart string        Restart policy to apply when a container exits (default "none")
-  -v, --volume stringArray    Volume. Ex: storageaccount/my_share[:/absolute/path/to/target][:ro]
+      --cpus float             Number of CPUs (default 1)
+  -d, --detach                 Run container in background and print container ID
+      --domainname string      Container NIS domain name
+  -e, --env stringArray        Set environment variables
+      --env-file stringArray   Path to environment files to be translated as environment variables
+  -l, --label stringArray      Set meta data on a container
+  -m, --memory bytes           Memory limit
+      --name string            Assign a name to the container
+  -p, --publish stringArray    Publish a container's port(s). [HOST_PORT:]CONTAINER_PORT
+      --restart string         Restart policy to apply when a container exits (default "none")
+  -v, --volume stringArray     Volume. Ex: storageaccount/my_share[:/absolute/path/to/target][:ro]