MCPcopy Index your code
hub / github.com/jetify-com/devbox / parseScriptArgs

Function parseScriptArgs

internal/boxcli/run.go:213–223  ·  view source on GitHub ↗
(args []string, flags runCmdFlags)

Source from the content-addressed store, hash-verified

211}
212
213func parseScriptArgs(args []string, flags runCmdFlags) (string, string, []string, error) {
214 if len(args) == 0 {
215 // this should never happen because cobra should prevent it, but it's better to be defensive.
216 return "", "", nil, usererr.New("no command or script provided")
217 }
218
219 script := args[0]
220 scriptArgs := args[1:]
221
222 return flags.config.path, script, scriptArgs, nil
223}
224
225func wrapArgsForRun(rootCmd *cobra.Command, args []string) []string {
226 // if the first argument is not "run", we don't need to do anything. If there

Callers 1

runScriptCmdFunction · 0.85

Calls 1

NewFunction · 0.92

Tested by

no test coverage detected