Skip to content

Commit 70491db

Browse files
CLOUDP-274948: Atlas CLI's plugin system does not support passing flags to plugins (#3280)
Co-authored-by: Max Marcon <me@marcon.me>
1 parent cb45e95 commit 70491db

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

internal/plugin/plugin.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ func (p *Plugin) GetCobraCommands() []*cobra.Command {
185185
}
186186
})
187187

188+
command.DisableFlagParsing = true
189+
188190
commands = append(commands, command)
189191
}
190192

test/e2e/atlas/plugin_run_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func TestPluginRun(t *testing.T) {
5656
})
5757

5858
t.Run("Echo", func(t *testing.T) {
59-
echoString := "this string will be the output of the echo command"
59+
echoString := "lorem ipsum dolor sit amet --test=true --debug --profile nunc nunc vel urna"
6060
cmd := exec.Command(cliPath,
6161
"example",
6262
"echo",
@@ -65,8 +65,9 @@ func TestPluginRun(t *testing.T) {
6565
if err != nil {
6666
t.Fatalf("unexpected error: %v, resp: %v", err, string(resp))
6767
}
68-
if !strings.Contains(string(resp), echoString) {
69-
t.Errorf("expected %q to contain %q\n", string(resp), echoString)
68+
actual := strings.TrimSpace(string(resp))
69+
if actual != echoString {
70+
t.Errorf("expected \"%q\" to contain %q\n", actual, echoString)
7071
}
7172
})
7273

0 commit comments

Comments
 (0)