Skip to content

Commit

Permalink
Move beater interface to cmd package
Browse files Browse the repository at this point in the history
  • Loading branch information
bobapple committed Dec 19, 2017
1 parent dd3104e commit 136ab9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
12 changes: 12 additions & 0 deletions cmd/root.go
@@ -0,0 +1,12 @@
package cmd

import (
cmd "github.com/elastic/beats/libbeat/cmd"
"github.com/icinga/icingabeat/beater"
)

// Name of this beat
var Name = "icingabeat"

// RootCmd to handle beats cli
var RootCmd = cmd.GenRootCmd(Name, "", beater.New)
7 changes: 2 additions & 5 deletions main.go
Expand Up @@ -3,14 +3,11 @@ package main
import (
"os"

"github.com/elastic/beats/libbeat/beat"

"github.com/icinga/icingabeat/beater"
"github.com/icinga/icingabeat/cmd"
)

func main() {
err := beat.Run("icingabeat", "", beater.New)
if err != nil {
if err := cmd.RootCmd.Execute(); err != nil {
os.Exit(1)
}
}

0 comments on commit 136ab9b

Please sign in to comment.