We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6cd6d9 commit 4a782daCopy full SHA for 4a782da
2 files changed
cmd/root.go
@@ -103,6 +103,11 @@ func SetVersion(version, commit string) {
103
rootCmd.Version = version + " (" + commit + ")"
104
}
105
106
+// PrintHelp prints the root command's help text.
107
+func PrintHelp() {
108
+ rootCmd.Help()
109
+}
110
+
111
// Execute runs the root command. It is the single entry point called by main.
112
func Execute() error {
113
return rootCmd.Execute()
main.go
@@ -17,6 +17,10 @@ var (
17
// main initialises the version string and delegates to the Cobra command tree.
18
func main() {
19
cmd.SetVersion(version, commit)
20
+ if len(os.Args) == 1 {
21
+ cmd.PrintHelp()
22
+ return
23
+ }
24
if err := cmd.Execute(); err != nil {
25
os.Exit(1)
26
0 commit comments