diff --git a/utils/modifycommand.go b/utils/modifycommand.go index 04e8ed0..34930b8 100644 --- a/utils/modifycommand.go +++ b/utils/modifycommand.go @@ -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)) }