mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-03 10:32:17 +00:00
fix console exit, closes #35
This commit is contained in:
parent
c31df4081c
commit
81b2697cce
@ -19,6 +19,10 @@ import (
|
|||||||
var client tmspcli.Client
|
var client tmspcli.Client
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
//workaround for the cli library (https://github.com/urfave/cli/issues/565)
|
||||||
|
cli.OsExiter = func(_ int) {}
|
||||||
|
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "tmsp-cli"
|
app.Name = "tmsp-cli"
|
||||||
app.Usage = "tmsp-cli [command] [args...]"
|
app.Usage = "tmsp-cli [command] [args...]"
|
||||||
@ -171,10 +175,7 @@ func cmdConsole(app *cli.App, c *cli.Context) error {
|
|||||||
|
|
||||||
args := []string{"tmsp-cli"}
|
args := []string{"tmsp-cli"}
|
||||||
args = append(args, strings.Split(string(line), " ")...)
|
args = append(args, strings.Split(string(line), " ")...)
|
||||||
if err := app.Run(args); err != nil {
|
app.Run(args) //cli already prints error within its func call
|
||||||
// if the command doesn't succeed, inform the user without exiting
|
|
||||||
fmt.Println("Error:", err.Error())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user