MCPcopy Create free account
hub / github.com/coder/envbuilder / supportLegacyEnvWithoutPrefixes

Function supportLegacyEnvWithoutPrefixes

options/options.go:537–553  ·  view source on GitHub ↗
(opts serpent.OptionSet)

Source from the content-addressed store, hash-verified

535}
536
537func supportLegacyEnvWithoutPrefixes(opts serpent.OptionSet) serpent.OptionSet {
538 withLegacyOpts := opts
539
540 for _, o := range opts {
541 if strings.HasPrefix(o.Env, envPrefix) {
542 prevOption := o
543 prevOption.Flag = "legacy-" + o.Flag
544 prevOption.Env = strings.TrimPrefix(o.Env, envPrefix)
545 prevOption.UseInstead = []serpent.Option{o}
546 prevOption.Hidden = true
547 prevOption.Default = ""
548 withLegacyOpts = append(withLegacyOpts, prevOption)
549 }
550 }
551
552 return withLegacyOpts
553}
554
555func (o *Options) Markdown() string {
556 cliOptions := skipDeprecatedOptions(o.CLI())

Callers 1

CLIMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected