Add chronoctl to Makefile

All usage information when no commands supplied
pull/2791/head
Michael Desa 2018-02-09 10:30:02 -05:00
parent 9a44a73086
commit 323c7df5c3
2 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,7 @@ UISOURCES := $(shell find ui -type f -not \( -path ui/build/\* -o -path ui/node_
unexport LDFLAGS
LDFLAGS=-ldflags "-s -X main.version=${VERSION} -X main.commit=${COMMIT}"
BINARY=chronograf
CTLBINARY=chronoctl
.DEFAULT_GOAL := all
@ -22,6 +23,7 @@ dev: dep dev-assets ${BINARY}
${BINARY}: $(SOURCES) .bindata .jsdep .godep
go build -o ${BINARY} ${LDFLAGS} ./cmd/chronograf/main.go
go build -o ${CTLBINARY} ${LDFLAGS} ./cmd/chronoctl
define CHRONOGIRAFFE
._ o o

View File

@ -1,6 +1,7 @@
package main
import (
"fmt"
"os"
"github.com/jessevdk/go-flags"
@ -18,8 +19,9 @@ func main() {
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp {
os.Exit(0)
} else {
fmt.Fprintln(os.Stdout)
parser.WriteHelp(os.Stdout)
os.Exit(1)
}
}
}