feat: When running from a symlink, use the executable name as the pattern argument

This commit is contained in:
Konstantin Tretyakov
2026-02-17 00:45:43 +01:00
parent dd2f1343ad
commit 40092d7e2c

View File

@@ -161,6 +161,16 @@ func Init() (ret *Flags, err error) {
}
return
}
if ret.Pattern == "" {
execName := filepath.Base(os.Args[0])
execName = strings.TrimSuffix(execName, filepath.Ext(execName))
if execName != "fabric" && execName != "main" && execName != "cmd" && execName != "" {
ret.Pattern = execName
usedFlags["pattern"] = true
}
}
debuglog.SetLevel(debuglog.LevelFromInt(ret.Debug))
// Check to see if a ~/.config/fabric/config.yaml config file exists (only when user didn't specify a config)