File: commands_info.go

package info (click to toggle)
golang-github-jamesclonk-vultr 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 560 kB
  • sloc: makefile: 35
file content (21 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package cmd

import (
	"log"

	"github.com/jawher/mow.cli"
)

func accountInfo(cmd *cli.Cmd) {
	cmd.Action = func() {
		info, err := GetClient().GetAccountInfo()
		if err != nil {
			log.Fatal(err)
		}

		lengths := []int{16, 16, 24, 24}
		tabsPrint(columns{"BALANCE", "PENDING CHARGES", "LAST PAYMENT DATE", "LAST PAYMENT AMOUNT"}, lengths)
		tabsPrint(columns{info.Balance, info.PendingCharges, info.LastPaymentDate, info.LastPaymentAmount}, lengths)
		tabsFlush()
	}
}