1 Commits

Author SHA1 Message Date
root 15e4156802 main.go: open test window on bare 'drover' (no subcommand)
Build / test (push) Successful in 19s
Build / build-windows (push) Successful in 6s
Release / release (push) Successful in 1m48s
Without this, double-clicking drover.exe printed CLI help to stdout —
fine in a terminal but invisible to a user who just clicked an icon.
Adding a RunE on the root command opens the smoke-test message box
when no subcommand was given. CLI flags (--version, --help) and
explicit subcommands keep their old behaviour.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 03:02:02 +03:00
+7
View File
@@ -39,6 +39,13 @@ func newRootCmd() *cobra.Command {
Version: fmt.Sprintf("%s (commit %s, built %s)", Version, Commit, BuildDate),
SilenceUsage: true,
SilenceErrors: false,
// No subcommand and no flags = end-user double-clicked the exe;
// open the smoke-test window instead of dumping CLI help to a
// console they didn't ask for.
RunE: func(cmd *cobra.Command, args []string) error {
showTestWindow()
return nil
},
}
// Custom version template: "drover-go vX.Y.Z (commit abc1234, built 2026-05-01)".