From 9da128db704d6ae11ec853bf38d6a4e7ac412fdb Mon Sep 17 00:00:00 2001 From: Chen Quan Date: Tue, 3 Jul 2018 20:14:57 +0800 Subject: [PATCH] cmd/p2psim: add exit error output and exit code (#17116) --- cmd/p2psim/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index d32c298631..6604b671fc 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -180,7 +180,10 @@ func main() { }, }, } - app.Run(os.Args) + if err := app.Run(os.Args); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } } func showNetwork(ctx *cli.Context) error {