diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-08 10:21:43 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-08 10:21:43 +0100 |
commit | e7c3ce2030313576cdf15e0eff26e59fcbeb4acc (patch) | |
tree | 830ac6123668ff6cc588c1b3ffdd4a41c5178237 | |
parent | 18893f9ed5f003133fad06b42a381effe4017bab (diff) |
Display help when no arg is set.
-rw-r--r-- | main.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -169,7 +169,10 @@ func main() { app.Before = func(ctx *cli.Context) error { var err error - // Don't init anything when user wants help + // Don't init anything when no argument or help option is set + if ctx.NArg() == 0 { + return nil + } for _, a := range ctx.Args() { switch a { case "-h", "--h", "-help", "--help": @@ -254,6 +257,7 @@ func XdsConnInit(ctx *cli.Context) error { return cli.NewExitError(errmsg, 1) } HTTPCli.SetLogLevel(ctx.String("loglevel")) + Log.Infoln("HTTP session ID : ", HTTPCli.GetClientID()) // Create io Websocket client Log.Debugln("Connecting IO.socket client on ", baseURL) |