Print help if no subcommand is given.

Closes #4
This commit is contained in:
Ryan Cavicchioni 2021-01-31 20:28:56 -06:00
parent 9321095e11
commit 0cbd256b86
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

View File

@ -17,6 +17,10 @@ func Main(args []string) (int, error) {
var config Config var config Config
var err error var err error
if len(args) == 1 {
args = append(args, "help")
}
configPath := getConfigPath() configPath := getConfigPath()
if configPath == "" { if configPath == "" {
err = errors.New("fatal: ~/.lumerc was not found") err = errors.New("fatal: ~/.lumerc was not found")
@ -39,7 +43,7 @@ func Main(args []string) (int, error) {
flag.Parse() flag.Parse()
command := flag.Arg(0) command := args[1]
c := lifx.NewClient(config.AccessToken) c := lifx.NewClient(config.AccessToken)