(n ast.Node)
| 50 | } |
| 51 | |
| 52 | func validateBatch(n ast.Node) error { |
| 53 | funcs := astutils.Search(n, named.IsParamFunc) |
| 54 | params := astutils.Search(n, named.IsParamSign) |
| 55 | args := astutils.Search(n, func(n ast.Node) bool { |
| 56 | _, ok := n.(*ast.ParamRef) |
| 57 | return ok |
| 58 | }) |
| 59 | if (len(params.Items) + len(funcs.Items) + len(args.Items)) == 0 { |
| 60 | return errors.New(":batch* commands require parameters") |
| 61 | } |
| 62 | return nil |
| 63 | } |
| 64 | |
| 65 | func Cmd(n ast.Node, name, cmd string) error { |
| 66 | if cmd == metadata.CmdCopyFrom { |