campaigner/cmd/sync.go

25 lines
510 B
Go
Raw Normal View History

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