From 571f30039297543c2c09aac85546ad8b7751dda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20H=C3=BCbinette?= Date: Mon, 12 Nov 2018 14:01:07 +0100 Subject: [PATCH] Add rendering of available transformer names to continuousLogSync help (#109) --- cmd/continuousLogSync.go | 7 ++++- pkg/transformers/shared/constants/label.go | 34 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/cmd/continuousLogSync.go b/cmd/continuousLogSync.go index 7bed2988..840708b6 100644 --- a/cmd/continuousLogSync.go +++ b/cmd/continuousLogSync.go @@ -15,6 +15,7 @@ package cmd import ( + "fmt" "log" "time" @@ -31,11 +32,15 @@ import ( var continuousLogSyncCmd = &cobra.Command{ Use: "continuousLogSync", Short: "Continuously sync logs at the head of the chain", - Long: `Continously syncs logs based on the configured transformers. + Long: fmt.Sprintf(`Continously syncs logs based on the configured transformers. vulcanizedb continousLogSync --config environments/local.toml + +Available transformers for (optional) selection with --transformers: +%v This command expects a light sync to have been run, and the presence of header records in the Vulcanize database.`, + constants.AllTransformerLabels()), Run: func(cmd *cobra.Command, args []string) { syncMakerLogs() }, diff --git a/pkg/transformers/shared/constants/label.go b/pkg/transformers/shared/constants/label.go index b50f7d6f..c86e86c1 100644 --- a/pkg/transformers/shared/constants/label.go +++ b/pkg/transformers/shared/constants/label.go @@ -31,3 +31,37 @@ var ( VatTuneLabel = "vatTune" VowFlogLabel = "vowFlog" ) + +func AllTransformerLabels() []string { + return []string{ + BiteLabel, + CatFileChopLumpLabel, + CatFileFlipLabel, + CatFilePitVowLabel, + DealLabel, + DentLabel, + DripDripLabel, + DripFileIlkLabel, + DripFileRepoLabel, + DripFileVowLabel, + FlapKickLabel, + FlipKickLabel, + FlopKickLabel, + FrobLabel, + PitFileDebtCeilingLabel, + PitFileIlkLabel, + PitFileStabilityFeeLabel, + PriceFeedLabel, + TendLabel, + VatFluxLabel, + VatFoldLabel, + VatGrabLabel, + VatHealLabel, + VatInitLabel, + VatMoveLabel, + VatSlipLabel, + VatTollLabel, + VatTuneLabel, + VowFlogLabel, + } +} \ No newline at end of file