If you’ve been following the blog, you know that I’m a fan of cobra as a CLI library. Let me share how I use tabwriter to compliment cobra’s autogenerated help information. For reference, you can check this post as well.
The following code is a copy (not an exact copy) of one of the tools that I use at work.
It will look something like this.
Trigger a manual run, among other tools.
Format for the --input flag:
payer:<id>[/link1,link2,...] run manual calculation at payer level, optional link acct list is for log filtering
msp:<id> run manual calculation at MSP level
link:<id> run manual calculation at link acct level
detectri:<msp|payer>[:id] run RI detection manually
detectsp:<msp|payer>[:id] run SavingsPlan detection manually
curlinks:<msp|payer>[:id] detect actual customers from CUR, can use --detect-moved-payer flag
fees:<id> detect fees for the input link id
detecttags:<id> detect tags for the input payer id
Notes:
* When triggering CUR (using trigger: input), it's recommended to use the --use-sns flag.
Usage:
linkbatchd manualrun [flags]
Flags:
--input string see subcommand description for more details
--date string date to trigger in UTC, fmt: yyyy-mm-dd, yyyy-mm-dd,yyyy-mm-dd for date range (from,to)
--invoice-type string type of invoice to calculate: 'account' or 'cross_tag', used in trigger: input