Add Disabled flag to ModifyCommand

This commit is contained in:
2025-07-19 11:08:51 +02:00
parent 3424fea8ad
commit 0b899dea2c

View File

@@ -21,6 +21,7 @@ type ModifyCommand struct {
LogLevel string `yaml:"loglevel"`
Isolate bool `yaml:"isolate"`
NoDedup bool `yaml:"nodedup"`
Disabled bool `yaml:"disable"`
}
type CookFile []ModifyCommand
@@ -185,8 +186,14 @@ func LoadCommands(args []string) ([]ModifyCommand, error) {
if err != nil {
return nil, fmt.Errorf("failed to load commands from cook files: %w", err)
}
logger.Info("Successfully loaded %d commands from cook iles", len(newcommands))
commands = append(commands, newcommands...)
logger.Info("Successfully loaded %d commands from cook files", len(newcommands))
for _, cmd := range newcommands {
if cmd.Disabled {
logger.Info("Skipping disabled command: %s", cmd.Name)
continue
}
commands = append(commands, cmd)
}
logger.Info("Now total commands: %d", len(commands))
}