From 6f0a43c573ce427c6d4ee5bd8343ead62596738d Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sun, 31 Jan 2021 20:28:56 -0600 Subject: [PATCH] Print help if no subcommand is given. Closes #4 --- cmd/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/main.go b/cmd/main.go index 815647c..a85fe6d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -17,6 +17,10 @@ func Main(args []string) (int, error) { var config Config var err error + if len(args) == 1 { + args = append(args, "help") + } + configPath := getConfigPath() if configPath == "" { err = errors.New("fatal: ~/.lumerc was not found") @@ -39,7 +43,7 @@ func Main(args []string) (int, error) { flag.Parse() - command := flag.Arg(0) + command := args[1] c := lifx.NewClient(config.AccessToken)