| 211 | } |
| 212 | |
| 213 | func 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 | |
| 225 | func wrapArgsForRun(rootCmd *cobra.Command, args []string) []string { |
| 226 | // if the first argument is not "run", we don't need to do anything. If there |