workdir default value is defined by compose file

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-08-20 15:18:03 +02:00
parent 789f556876
commit 838937c907
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
5 changed files with 7 additions and 6 deletions

View File

@ -21,8 +21,9 @@ import (
"fmt"
"github.com/compose-spec/compose-go/cli"
"github.com/docker/api/client"
"github.com/spf13/cobra"
"github.com/docker/api/client"
)
func convertCommand() *cobra.Command {
@ -39,7 +40,7 @@ func convertCommand() *cobra.Command {
},
}
convertCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name")
convertCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir")
convertCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir")
convertCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files")
return convertCmd

View File

@ -35,7 +35,7 @@ func downCommand() *cobra.Command {
},
}
downCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name")
downCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir")
downCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir")
downCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files")
return downCmd

View File

@ -35,7 +35,7 @@ func logsCommand() *cobra.Command {
},
}
logsCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name")
logsCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir")
logsCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir")
logsCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files")
return logsCmd

View File

@ -39,7 +39,7 @@ func psCommand() *cobra.Command {
},
}
psCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name")
psCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir")
psCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir")
psCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files")
return psCmd

View File

@ -35,7 +35,7 @@ func upCommand() *cobra.Command {
},
}
upCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name")
upCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir")
upCmd.Flags().StringVar(&opts.WorkingDir, "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")