don't skip `compose` used as project name

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2023-06-05 16:46:06 +02:00
parent 629c9f62e9
commit 60fe97416c
2 changed files with 5 additions and 4 deletions

View File

@ -62,10 +62,6 @@ func Convert(args []string) []string {
continue
}
if len(arg) > 0 && arg[0] != '-' {
// not a top-level flag anymore, keep the rest of the command unmodified
if arg == compose.PluginName {
i++
}
command = append(command, args[i:]...)
break
}

View File

@ -83,6 +83,11 @@ func Test_convert(t *testing.T) {
args: []string{"--project-directory", "", "ps"},
want: []string{"compose", "--project-directory", "", "ps"},
},
{
name: "compose as project name",
args: []string{"--project-name", "compose", "down", "--remove-orphans"},
want: []string{"compose", "--project-name", "compose", "down", "--remove-orphans"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {