File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,15 @@ func getStringFlags() []string {
4343 }
4444}
4545
46+ var argToActualFlag = map [string ]string {
47+ "--verbose" : "--debug" ,
48+ // docker cli has deprecated -h to avoid ambiguity with -H, while docker-compose still support it
49+ "-h" : "--help" ,
50+ // redirect --version pseudo-command to actual command
51+ "--version" : "version" ,
52+ "-v" : "version" ,
53+ }
54+
4655// Convert transforms standalone docker-compose args into CLI plugin compliant ones
4756func Convert (args []string ) []string {
4857 var rootFlags []string
@@ -58,16 +67,8 @@ func Convert(args []string) []string {
5867 command = append (command , args [i :]... )
5968 break
6069 }
61- if arg == "--verbose" {
62- arg = "--debug"
63- }
64- if arg == "-h" {
65- // docker cli has deprecated -h to avoid ambiguity with -H, while docker-compose still support it
66- arg = "--help"
67- }
68- if arg == "--version" || arg == "-v" {
69- // redirect --version pseudo-command to actual command
70- arg = "version"
70+ if actualFlag , ok := argToActualFlag [arg ]; ok {
71+ arg = actualFlag
7172 }
7273 if contains (getBoolFlags (), arg ) {
7374 rootFlags = append (rootFlags , arg )
You can’t perform that action at this time.
0 commit comments