Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Better descriptions and no crashing when config file / folder is missing #22

Open
zpeters opened this issue May 22, 2018 · 0 comments
Open

Comments

@zpeters
Copy link
Owner

zpeters commented May 22, 2018

root@c815f25f4029:~# chmod +x nerdnest-linux-amd64-v0.0.2-c
root@c815f25f4029:~# ./nerdnest-linux-amd64-v0.0.2-c
panic: runtime error: index out of range

goroutine 1 [running]:
main.init.0()
	/Users/zachpeters/go/src/github.com/zpeters/nerdnest/cmd/nerdnest/main.go:39 +0x2d0
main.init()
	<autogenerated>:1 +0x18a
root@c815f25f4029:~# ./nerdnest-linux-amd64-v0.0.2-c  -hj
Please make sure you have created a config file
See https://github.com/zpeters/nerdnest/ for examples
2018/05/22 02:27:33 Fatal error config file: Config File "nerdnest" Not Found in "[/root/.nerdnest /root]"
root@c815f25f4029:~# mkdir /root/.nerdnest
root@c815f25f4029:~# cd
root@c815f25f4029:~# cd .nerdnest/
root@c815f25f4029:~/.nerdnest# ls
root@c815f25f4029:~/.nerdnest# touch nerdnest.toml
root@c815f25f4029:~/.nerdnest# cd
root@c815f25f4029:~# ls
nerdnest-linux-amd64-v0.0.2-c
root@c815f25f4029:~# ./nerdnest-linux-amd64-v0.0.2-c
Usage:
  nerdnest [command]

Available Commands:
  away        'home' or 'away'
  help        Help about any command
  list        List devices
  register    Register with nest
  setdefault  Set default thermostat
  status      Current Status
  temp        Set target temp
  version     Show build information

Flags:
  -h, --help   help for nerdnest

Use "nerdnest [command] --help" for more information about a command.
root@c815f25f4029:~# ./nerdnest-linux-amd64-v0.0.2-c
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant