MCPcopy Index your code
hub / github.com/docker-exec/dexec / validate

Function validate

main.go:136–154  ·  view source on GitHub ↗
(cliParser cli.CLI)

Source from the content-addressed store, hash-verified

134}
135
136func validate(cliParser cli.CLI) bool {
137 options := cliParser.Options
138
139 hasVersionFlag := len(options[cli.VersionFlag]) == 1
140 hasSources := len(options[cli.Source]) > 0
141 shouldClean := len(options[cli.CleanFlag]) > 0
142
143 if hasSources || shouldClean {
144 return true
145 }
146
147 if hasVersionFlag {
148 cli.DisplayVersion(cliParser.Filename)
149 return false
150 }
151
152 cli.DisplayHelp(cliParser.Filename)
153 return false
154}
155
156func validateDocker() error {
157 client, err := docker.NewClientFromEnv()

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected