Add rendering of available transformer names to continuousLogSync help (#109)

This commit is contained in:
Edvard Hübinette 2018-11-12 14:01:07 +01:00 committed by GitHub
parent 672269effa
commit 571f300392
2 changed files with 40 additions and 1 deletions

View File

@ -15,6 +15,7 @@
package cmd package cmd
import ( import (
"fmt"
"log" "log"
"time" "time"
@ -31,11 +32,15 @@ import (
var continuousLogSyncCmd = &cobra.Command{ var continuousLogSyncCmd = &cobra.Command{
Use: "continuousLogSync", Use: "continuousLogSync",
Short: "Continuously sync logs at the head of the chain", 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 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.`, 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) { Run: func(cmd *cobra.Command, args []string) {
syncMakerLogs() syncMakerLogs()
}, },

View File

@ -31,3 +31,37 @@ var (
VatTuneLabel = "vatTune" VatTuneLabel = "vatTune"
VowFlogLabel = "vowFlog" 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,
}
}