Files
go-worm/lib/instance/args.go
T
kato e74f74bc4e fix(startup): make watchdog task keep agent alive
- Use Task Scheduler XML instead of /TR
- Run -ensure agent in-process, not child
- Add console close and panic protection
- Guard nil event channels after stop
- Add non-Windows stubs for startup/mutex
2026-09-01 23:12:22 +03:00

22 lines
518 B
Go

package instance
import "strings"
func filterArgs(args []string) []string {
out := make([]string, 0, len(args))
for _, arg := range args {
name := strings.TrimLeft(arg, "-/")
lower := strings.ToLower(name)
switch {
case lower == "background" || strings.HasPrefix(lower, "background="):
continue
case lower == "foreground" || strings.HasPrefix(lower, "foreground="):
continue
case lower == "ensure" || strings.HasPrefix(lower, "ensure="):
continue
}
out = append(out, arg)
}
return out
}