campaigner/cmd/sync.go

25 lines
510 B
Go
Raw Normal View History

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