From f176064a1de9b61d5715144df21b2f00229ffa00 Mon Sep 17 00:00:00 2001 From: Yakiyo Date: Tue, 22 Aug 2023 16:08:05 +0000 Subject: [PATCH] feat: help on no args --- cmd/root.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 0c69d6e..34d4eea 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -35,6 +35,11 @@ func Execute() { NoExtraNewlines: true, }) + if len(os.Args[1:]) < 1 { + rootCmd.Help() + os.Exit(1) + } + if err := rootCmd.Execute(); err != nil { log.Error(err) os.Exit(1)