summaryrefslogtreecommitdiffstats
path: root/client/go/script-utils/startcbinary/cmd.go
blob: 49bc2c8aedcf86cbd2125a0c85be812534f6607b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej

package startcbinary

import (
	"github.com/vespa-engine/vespa/client/go/trace"
	"github.com/vespa-engine/vespa/client/go/vespa"
)

func Run(args []string) bool {
	trace.AdjustVerbosity(1)
	if len(args) < 1 {
		trace.Warning("missing program argument")
		return false
	}
	spec := ProgSpec{
		Program: args[0],
		Args:    args[1:],
	}
	spec.setup()
	vespa.LoadDefaultEnv()
	return startCbinary(spec)
}