From 90914603baf1c7daa77b6143f9bff0b4fa352fd3 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Tue, 23 Jun 2020 16:12:03 +0200 Subject: [PATCH] Add ACI detach flags, not used at the moment, but more makes new command more compatible with previous ones. --- cli/cmd/compose/up.go | 1 + cli/cmd/run/run.go | 1 + cli/cmd/run/testdata/run-help.golden | 1 + 3 files changed, 3 insertions(+) diff --git a/cli/cmd/compose/up.go b/cli/cmd/compose/up.go index bafaf06b9..a16c0bacd 100644 --- a/cli/cmd/compose/up.go +++ b/cli/cmd/compose/up.go @@ -39,6 +39,7 @@ func upCommand() *cobra.Command { upCmd.Flags().StringVar(&opts.WorkDir, "workdir", ".", "Work dir") upCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files") upCmd.Flags().StringArrayVarP(&opts.Environment, "environment", "e", []string{}, "Environment variables") + upCmd.Flags().BoolP("detach", "d", true, " Detached mode: Run containers in the background") return upCmd } diff --git a/cli/cmd/run/run.go b/cli/cmd/run/run.go index 901828385..4431b9bb1 100644 --- a/cli/cmd/run/run.go +++ b/cli/cmd/run/run.go @@ -43,6 +43,7 @@ func Command() *cobra.Command { cmd.Flags().StringVar(&opts.Name, "name", "", "Assign a name to the container") cmd.Flags().StringArrayVarP(&opts.Labels, "label", "l", []string{}, "Set meta data on a container") cmd.Flags().StringArrayVarP(&opts.Volumes, "volume", "v", []string{}, "Volume. Ex: user:key@my_share:/absolute/path/to/target") + cmd.Flags().BoolP("detach", "d", true, "Run container in background and print container ID") return cmd } diff --git a/cli/cmd/run/testdata/run-help.golden b/cli/cmd/run/testdata/run-help.golden index 7bdf7de85..2a5a55f56 100644 --- a/cli/cmd/run/testdata/run-help.golden +++ b/cli/cmd/run/testdata/run-help.golden @@ -4,6 +4,7 @@ Usage: run [flags] Flags: + -d, --detach Run container in background and print container ID (default true) -l, --label stringArray Set meta data on a container --name string Assign a name to the container -p, --publish stringArray Publish a container's port(s). [HOST_PORT:]CONTAINER_PORT