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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user