-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.go
53 lines (41 loc) · 1.04 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"github.com/cppforlife/go-cli-ui/ui"
uitbl "github.com/cppforlife/go-cli-ui/ui/table"
)
type NullLogger struct{}
var _ ui.ExternalLogger = NullLogger{}
func (l NullLogger) Error(tag, msg string, args ...interface{}) {}
func (l NullLogger) Debug(tag, msg string, args ...interface{}) {}
func main() {
ui := ui.NewConfUI(NullLogger{})
table := uitbl.Table{
Content: "stemcells",
Header: []uitbl.Header{
uitbl.NewHeader("Name"),
uitbl.NewHeader("Version"),
uitbl.NewHeader("OS"),
uitbl.NewHeader("CPI"),
uitbl.NewHeader("CID"),
},
SortBy: []uitbl.ColumnSort{
{Column: 0, Asc: true},
{Column: 1, Asc: false},
},
Notes: []string{"(*) Currently deployed"},
}
stemcells := []struct{}{}
for _, _ = range stemcells {
table.Rows = append(table.Rows, []uitbl.Value{
uitbl.NewValueString("name"),
uitbl.NewValueSuffix(
uitbl.NewValueString("version"),
"*",
),
uitbl.NewValueString("name"),
uitbl.NewValueString("cpi"),
uitbl.NewValueString("cid"),
})
}
ui.PrintTable(table)
}