Fixed critical issues identified in code review: - Fixed invalid Go version (1.25.2 → 1.21) in go.mod - Fixed unchecked error in import.go JSON unmarshaling - Fixed unchecked error returns in test cleanup (export_import_test.go, import_collision_test.go) - Removed duplicate test code in dependencies_test.go via helper function Added release infrastructure: - Added 'bd version' command with JSON output support - Created comprehensive CHANGELOG.md following Keep a Changelog format - Updated README.md with clear alpha status warnings All tests passing. Ready for public repository opening. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
559 B
Go
34 lines
559 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
const (
|
|
// Version is the current version of bd
|
|
Version = "0.9.0"
|
|
// Build can be set via ldflags at compile time
|
|
Build = "dev"
|
|
)
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print version information",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
if jsonOutput {
|
|
outputJSON(map[string]string{
|
|
"version": Version,
|
|
"build": Build,
|
|
})
|
|
} else {
|
|
fmt.Printf("bd version %s (%s)\n", Version, Build)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|