Skip to content

Commit f6ea63c

Browse files
committed
feat: add --detach/-d flag to up
1 parent dcdec12 commit f6ea63c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cmd/cli/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ var composeUpCmd = &cobra.Command{
404404
RunE: func(cmd *cobra.Command, args []string) error {
405405
var filePath, _ = cmd.InheritedFlags().GetString("file")
406406
var force, _ = cmd.Flags().GetBool("force")
407+
var detach, _ = cmd.Flags().GetBool("detach")
407408

408409
serviceInfos, err := cli.ComposeStart(cmd.Context(), client, filePath, string(tenantId), force)
409410
if err != nil {
@@ -412,6 +413,10 @@ var composeUpCmd = &cobra.Command{
412413

413414
printEndpoints(serviceInfos)
414415

416+
if detach {
417+
return nil
418+
}
419+
415420
var etag string
416421
services := "all services"
417422
if len(serviceInfos) == 1 {
@@ -688,6 +693,7 @@ func main() {
688693
// composeCmd.Flags().StringP("project", "p", "", "Compose project name"); TODO: Implement compose option
689694
composeUpCmd.Flags().Bool("tail", false, "Tail the service logs after updating") // obsolete, but keep for backwards compatibility
690695
composeUpCmd.Flags().Bool("force", false, "Force a build of the image even if nothing has changed")
696+
composeUpCmd.Flags().BoolP("detach", "d", false, "Run in detached mode")
691697
composeCmd.AddCommand(composeUpCmd)
692698
composeCmd.AddCommand(composeConfigCmd)
693699
composeDownCmd.Flags().Bool("tail", false, "Tail the service logs after deleting")

0 commit comments

Comments
 (0)