Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "swab [device ID]", Short: "Refreshes the database/ui of a pi", Long: "Forces a replication of the couch database, and causes the ui to refresh shortly after", Args: args.ValidDeviceID, Run: func(cmd *cobra.Command, arg []string) { fmt.Printf("Swabbing %s\n", arg[0]) db, _, err := args.GetDB() if err != nil { fmt.Printf("unable to get database: %v", err) os.Exit(1) } device, err := db.GetDevice(arg[0]) if err != nil { fmt.Printf("unable to get device from database: %s\n", err) os.Exit(1) } err = swab(context.TODO(), device.Address) if err != nil { fmt.Printf("unable to swab %s: %s\n", device.ID, err) os.Exit(1) } fmt.Printf("Successfully swabbed %s\n", device.ID) }, }
Cmd .
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.