package temperature import ( "github.com/spf13/cobra" ) var configDir, sensorName, wirePath string var temperatureSensorCmd = &cobra.Command{ Use: "temperature", Short: "Manage Temperature Sensors", } // Execute a func InitCmd(cmd *cobra.Command, cnf string) { configDir = cnf cmd.AddCommand(temperatureSensorCmd) temperatureSensorCmd.PersistentFlags().StringVarP(&sensorName, "name", "n", "", "Define an name for the sensor") temperatureSensorCmd.PersistentFlags().StringVarP(&wirePath, "wire-path", "w", "/sys/bus/w1/devices", "Default path for wire devices") }