From b93e15eb09b3dd9cd5e9d5841aa2d10e036120d2 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Wed, 25 Jul 2018 19:45:09 -0400 Subject: [PATCH] fix ytsync update command --- cmd/ytsync.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ytsync.go b/cmd/ytsync.go index 19b922c..05c2947 100644 --- a/cmd/ytsync.go +++ b/cmd/ytsync.go @@ -43,7 +43,7 @@ func init() { ytSyncCmd.Flags().IntVar(&limit, "limit", 0, "limit the amount of channels to sync") ytSyncCmd.Flags().BoolVar(&skipSpaceCheck, "skip-space-check", false, "Do not perform free space check on startup") ytSyncCmd.Flags().BoolVar(&syncUpdate, "update", false, "Update previously synced channels instead of syncing new ones (short for --status synced)") - ytSyncCmd.Flags().StringVar(&syncStatus, "status", sync.StatusQueued, "Specify which queue to pull from. Overrides --update (Default: queued)") + ytSyncCmd.Flags().StringVar(&syncStatus, "status", "", "Specify which queue to pull from. Overrides --update") ytSyncCmd.Flags().StringVar(&channelID, "channelID", "", "If specified, only this channel will be synced.") ytSyncCmd.Flags().Int64Var(&syncFrom, "after", time.Unix(0, 0).Unix(), "Specify from when to pull jobs [Unix time](Default: 0)") ytSyncCmd.Flags().Int64Var(&syncUntil, "before", time.Now().Unix(), "Specify until when to pull jobs [Unix time](Default: current Unix time)") @@ -67,7 +67,7 @@ func ytSync(cmd *cobra.Command, args []string) { util.InitSlack(os.Getenv("SLACK_TOKEN"), os.Getenv("SLACK_CHANNEL"), hostname) } - if !util.InSlice(syncStatus, sync.SyncStatuses) { + if syncStatus != "" && !util.InSlice(syncStatus, sync.SyncStatuses) { log.Errorf("status must be one of the following: %v\n", sync.SyncStatuses) return }