no more init() and package level config.

This commit is contained in:
Erik Brakkee 2026-05-26 23:15:59 +02:00
parent ed4f75a93d
commit e99348c66d

View File

@ -30,7 +30,8 @@ func newConfig() *config {
return &config{}
}
var rootCmd = &cobra.Command{
func main() {
rootCmd := &cobra.Command{
Use: "bridge",
Short: "ANT+ to Bluetooth LE bridge",
Long: `Bridge an ANT+ cycling power trainer over Bluetooth Low Energy.
@ -74,15 +75,11 @@ This allows these trainers to be used with modern devices that don't support ANT
return nil
},
}
}
func init() {
rootCmd.Flags().String("vendor", "0x0fcf", "USB vendor ID (hex, e.g. 0x0fcf)")
rootCmd.Flags().String("product", "0x1008", "USB product ID (hex, e.g. 0x1008)")
rootCmd.Flags().String("device", "3001", "ANT+ device number (hex or decimal, e.g. 3001 or 0xbb9)")
}
func main() {
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}