Allow specifying --agent none
to mean no agent
This commit is contained in:
parent
a46d211e10
commit
172bfc57e1
@ -83,7 +83,7 @@ func validateGenerationFlags(ctx *lmcli.Context, cmd *cobra.Command) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error parsing --agent: %w", err)
|
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 fmt.Errorf("Unknown agent: %s", agent)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -86,7 +86,7 @@ func (c *Context) GetAgents() (agents []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) GetAgent(name string) *Agent {
|
func (c *Context) GetAgent(name string) *Agent {
|
||||||
if name == "" {
|
if name == "" || name == "none" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user