toProjectOptionsFns converts config options to cli.ProjectOptionsFn
()
| 75 | |
| 76 | // toProjectOptionsFns converts config options to cli.ProjectOptionsFn |
| 77 | func (o *configOptions) toProjectOptionsFns() []cli.ProjectOptionsFn { |
| 78 | fns := []cli.ProjectOptionsFn{ |
| 79 | cli.WithInterpolation(!o.noInterpolate), |
| 80 | cli.WithResolvedPaths(!o.noResolvePath), |
| 81 | cli.WithNormalization(!o.noNormalize), |
| 82 | cli.WithConsistency(!o.noConsistency), |
| 83 | cli.WithDefaultProfiles(o.Profiles...), |
| 84 | cli.WithDiscardEnvFile, |
| 85 | } |
| 86 | if o.noResolveEnv { |
| 87 | fns = append(fns, cli.WithoutEnvironmentResolution) |
| 88 | } |
| 89 | return fns |
| 90 | } |
| 91 | |
| 92 | func configCommand(p *ProjectOptions, dockerCli command.Cli) *cobra.Command { |
| 93 | opts := configOptions{ |