no more init() and package level config.
This commit is contained in:
parent
ed4f75a93d
commit
e99348c66d
@ -30,7 +30,8 @@ func newConfig() *config {
|
|||||||
return &config{}
|
return &config{}
|
||||||
}
|
}
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
func main() {
|
||||||
|
rootCmd := &cobra.Command{
|
||||||
Use: "bridge",
|
Use: "bridge",
|
||||||
Short: "ANT+ to Bluetooth LE bridge",
|
Short: "ANT+ to Bluetooth LE bridge",
|
||||||
Long: `Bridge an ANT+ cycling power trainer over Bluetooth Low Energy.
|
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
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
|
||||||
rootCmd.Flags().String("vendor", "0x0fcf", "USB vendor ID (hex, e.g. 0x0fcf)")
|
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("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)")
|
rootCmd.Flags().String("device", "3001", "ANT+ device number (hex or decimal, e.g. 3001 or 0xbb9)")
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user