diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-08-28 08:48:33 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-08-28 08:48:33 +0200 |
commit | ebb04d162f47f4324672813b3eb0ce3137c3e80f (patch) | |
tree | 0af8cf42798c356dd98462190fcbc59baf058537 /main.go | |
parent | 5358e812c1a5d16c28ab5fa0c149670790ae673e (diff) |
Fixed --help and --version when no config file found.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -190,8 +190,12 @@ endloop: // Source config env file // (we cannot use confFile var because env variables setting is just after) envMap, confFile, err := loadConfigEnvFile(os.Getenv("XDS_CONFIG"), gdbCmdFile) - if err != nil { - exitError(syscall.ENOENT, err.Error()) + + // Only rise an error when args is not set (IOW when --help or --version is not set) + if len(args) == 1 { + if err != nil { + exitError(syscall.ENOENT, err.Error()) + } } // Managed env vars and create help |