Skip to content

Instantly share code, notes, and snippets.

@flowerinthenight
Last active February 27, 2020 13:50
Show Gist options
  • Save flowerinthenight/d00e0d81ba85b3940312f0a3c33bcaef to your computer and use it in GitHub Desktop.
Save flowerinthenight/d00e0d81ba85b3940312f0a3c33bcaef to your computer and use it in GitHub Desktop.
rootCmd = &cobra.Command{
Use: "manualrun",
Short: "trigger a manual run",
Long: func() string {
var b bytes.Buffer
wb := bufio.NewWriter(&b)
h := tabwriter.NewWriter(wb, 0, 10, 5, ' ', 0)
fmt.Fprintf(h, "Trigger a manual run, among other tools.\n\n")
fmt.Fprintf(h, "Format for the --input flag:\n")
fmt.Fprintf(h, " payer:<id>[/link1,link2,...]\trun manual calculation at payer level, optional acct list is for log filtering\n")
fmt.Fprintf(h, " msp:<id>\trun manual calculation at MSP level\n")
fmt.Fprintf(h, " link:<id>\trun manual calculation at link acct level\n")
fmt.Fprintf(h, " detectri:<msp|payer>[:id]\trun RI detection manually\n")
fmt.Fprintf(h, " detectsp:<msp|payer>[:id]\trun SavingsPlan detection manually\n")
fmt.Fprintf(h, " curlinks:<msp|payer>[:id]\tdetect actual customers from CUR, can use --detect-moved-payer flag\n")
fmt.Fprintf(h, " fees:<id>\tdetect fees for the input link id\n")
fmt.Fprintf(h, " detecttags:<id>\tdetect tags for the input payer id\n\n")
fmt.Fprintf(h, "Notes:\n")
fmt.Fprintf(h, " * When triggering CUR (using trigger: input), it's recommended to use the --use-sns flag.\n\n")
h.Flush()
wb.Flush()
return b.String()
}(),
RunE: func(cmd *cobra.Command, args []string) error {
defer func(begin time.Time) {
log.Println("duration:", time.Since(begin))
}(time.Now())
// redacted
return nil
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment