(inv *serpent.Invocation, flagName, envName string)
| 290 | } |
| 291 | |
| 292 | func isPortExplicit(inv *serpent.Invocation, flagName, envName string) bool { |
| 293 | if flag := inv.ParsedFlags().Lookup(flagName); flag != nil && flag.Changed { |
| 294 | return true |
| 295 | } |
| 296 | if val, ok := inv.Environ.Lookup(envName); ok && val != "" { |
| 297 | return true |
| 298 | } |
| 299 | for _, opt := range inv.Command.Options { |
| 300 | if opt.Flag == flagName { |
| 301 | return opt.ValueSource == serpent.ValueSourceFlag || |
| 302 | opt.ValueSource == serpent.ValueSourceEnv |
| 303 | } |
| 304 | } |
| 305 | return false |
| 306 | } |
| 307 | |
| 308 | // portOffset returns a deterministic offset in [0, 1000) derived from the |
| 309 | // worktree path. Successive callers with the same projectRoot get the same |
no outgoing calls
no test coverage detected