From 2151f6f5d65957bbb9de9d086e4016076ce70972 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 17 Apr 2015 11:45:13 -0700 Subject: [PATCH] barak takes an output-file as option --- cmd/barak/main.go | 13 +++++++++++-- cmd/debora/README.md | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cmd/barak/main.go b/cmd/barak/main.go index 1da935c87..4c056e6be 100644 --- a/cmd/barak/main.go +++ b/cmd/barak/main.go @@ -6,6 +6,7 @@ package main import ( "errors" + "flag" "fmt" "io" "io/ioutil" @@ -51,9 +52,17 @@ var barak = struct { func main() { fmt.Printf("New Barak Process (PID: %d)\n", os.Getpid()) - // read options from stdin. + // read flags to change options file. + var optionsBytes []byte + var optionsFile string var err error - optionsBytes, err := ioutil.ReadAll(os.Stdin) + flag.StringVar(&optionsFile, "options-file", "", "Read options from file instead of stdin") + flag.Parse() + if optionsFile != "" { + optionsBytes, err = ioutil.ReadFile(optionsFile) + } else { + optionsBytes, err = ioutil.ReadAll(os.Stdin) + } if err != nil { panic(Fmt("Error reading input: %v", err)) } diff --git a/cmd/debora/README.md b/cmd/debora/README.md index 6ff6218aa..4262d01c7 100644 --- a/cmd/debora/README.md +++ b/cmd/debora/README.md @@ -7,4 +7,7 @@ # Build tendermint from source ./build/debora run -- build_tendermint bash -c "cd $GOPATH/src/github.com/tendermint/tendermint; make" + +# Build and run tendermint +./build/debora run -- tendermint bash -c "cd \$GOPATH/src/github.com/tendermint/tendermint; make; ./build/tendermint node" ```