campaigner/cmd/sync.go
2020-09-21 09:27:50 +02:00

24 lines
510 B
Go

package cmd
import (
"git.ctrlz.es/mgdelacroix/campaigner/app"
"github.com/spf13/cobra"
)
func SyncCmd() *cobra.Command {
return &cobra.Command{
Use: "sync",
Short: "Syncs the tickets",
Long: "Synchronizes the status of the published tickets with remote providers",
Args: cobra.NoArgs,
Run: withApp(syncCmdF),
}
}
func syncCmdF(a *app.App, cmd *cobra.Command, _ []string) {
if err := a.GithubSync(); err != nil {
ErrorAndExit(cmd, err)
}
cmd.Println("Synchronization completed")
}