feat: Add --version/-v flag support

Agents often try 'bd --version' as a standard CLI pattern.
Now supports both:
- bd --version (or -v)
- bd version (existing subcommand)
This commit is contained in:
Steve Yegge
2025-10-26 14:24:05 -07:00
parent 80b0af9457
commit f34eca1e2e

View File

@@ -2402,6 +2402,14 @@ func init() {
}
func main() {
// Handle --version flag (in addition to 'version' subcommand)
for _, arg := range os.Args[1:] {
if arg == "--version" || arg == "-v" {
fmt.Printf("bd version %s (%s)\n", Version, Build)
return
}
}
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}