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 {
43
43
}
44
44
}
45
45
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
+
46
55
// Convert transforms standalone docker-compose args into CLI plugin compliant ones
47
56
func Convert (args []string ) []string {
48
57
var rootFlags []string
@@ -58,16 +67,8 @@ func Convert(args []string) []string {
58
67
command = append (command , args [i :]... )
59
68
break
60
69
}
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
71
72
}
72
73
if contains (getBoolFlags (), arg ) {
73
74
rootFlags = append (rootFlags , arg )
You can’t perform that action at this time.
0 commit comments