From 172bfc57e1b0c6df8c3f0bd57f10f1243a40784f Mon Sep 17 00:00:00 2001 From: Matt Low Date: Mon, 23 Sep 2024 03:04:43 +0000 Subject: [PATCH] Allow specifying `--agent none` to mean no agent --- pkg/cmd/cmd.go | 2 +- pkg/lmcli/lmcli.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index f7ef736..6e63b6a 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -83,7 +83,7 @@ func validateGenerationFlags(ctx *lmcli.Context, cmd *cobra.Command) error { if err != nil { return fmt.Errorf("Error parsing --agent: %w", err) } - if agent != "" && !slices.Contains(ctx.GetAgents(), agent) { + if agent != "" && agent != "none" && !slices.Contains(ctx.GetAgents(), agent) { return fmt.Errorf("Unknown agent: %s", agent) } return nil diff --git a/pkg/lmcli/lmcli.go b/pkg/lmcli/lmcli.go index e5f6e8c..2235376 100644 --- a/pkg/lmcli/lmcli.go +++ b/pkg/lmcli/lmcli.go @@ -86,7 +86,7 @@ func (c *Context) GetAgents() (agents []string) { } func (c *Context) GetAgent(name string) *Agent { - if name == "" { + if name == "" || name == "none" { return nil }