27 lines
531 B
Go
27 lines
531 B
Go
|
package remote
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
|
||
|
"git.cryptic.systems/fh-trier/go-flucky/pkg/httpcall"
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
var force bool
|
||
|
|
||
|
var syncRemoteCmd = &cobra.Command{
|
||
|
Use: "sync",
|
||
|
Short: "Synchronise Device Values with Remote Servers",
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
|
||
|
if err := httpcall.SyncDevice(configDir, force); err != nil {
|
||
|
log.Fatal(err)
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
remoteCmd.AddCommand(syncRemoteCmd)
|
||
|
syncRemoteCmd.Flags().BoolVarP(&force, "force", "f", false, "Include disabled remote links")
|
||
|
}
|