diff --git a/opal-task/cmd/root.go b/opal-task/cmd/root.go index 58a7c71..934439c 100644 --- a/opal-task/cmd/root.go +++ b/opal-task/cmd/root.go @@ -48,6 +48,16 @@ It supports filtering, tags, priorities, projects, and recurring tasks.`, } func Execute() error { + // Check for help flags/command BEFORE preprocessing + // This allows Cobra to handle help naturally for the root command + if len(os.Args) > 1 { + firstArg := os.Args[1] + if firstArg == "-h" || firstArg == "--help" || firstArg == "help" { + // Let Cobra handle help - skip preprocessing + return rootCmd.Execute() + } + } + // Preprocess arguments BEFORE Cobra routing if len(os.Args) > 1 { parsed := preprocessArgs(os.Args[1:])