Code Review
/
src
/
xds
/
xds-cli.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
|
inline
| side by side (parent:
18893f9
)
Display help when no arg is set.
author
Sebastien Douheret
<sebastien.douheret@iot.bzh>
Wed, 8 Nov 2017 09:21:43 +0000
(10:21 +0100)
committer
Sebastien Douheret
<sebastien.douheret@iot.bzh>
Wed, 8 Nov 2017 09:21:43 +0000
(10:21 +0100)
main.go
patch
|
blob
|
history
diff --git
a/main.go
b/main.go
index
eec23da
..
090144d
100644
(file)
--- a/
main.go
+++ b/
main.go
@@
-169,7
+169,10
@@
func main() {
app.Before = func(ctx *cli.Context) error {
var err error
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":
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"))
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)
// Create io Websocket client
Log.Debugln("Connecting IO.socket client on ", baseURL)