Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/cmd/internal/flowmode/flowmode.go
4094 views
1
// Package flowmode is the entrypoint for Grafana Agent Flow.
2
package flowmode
3
4
import (
5
"fmt"
6
"os"
7
8
"github.com/grafana/agent/pkg/build"
9
"github.com/spf13/cobra"
10
)
11
12
// Run is the entrypoint to Flow mode. It is expected to be called
13
// directly from the main function.
14
func Run() {
15
var cmd = &cobra.Command{
16
Use: fmt.Sprintf("%s [global options] <subcommand>", os.Args[0]),
17
Short: "Grafana Agent Flow",
18
Version: build.Print("agent"),
19
20
RunE: func(cmd *cobra.Command, args []string) error {
21
return cmd.Usage()
22
},
23
}
24
cmd.SetVersionTemplate("{{ .Version }}\n")
25
26
cmd.AddCommand(
27
fmtCommand(),
28
runCommand(),
29
)
30
31
if err := cmd.Execute(); err != nil {
32
os.Exit(1)
33
}
34
}
35
36