Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Add A Method To Draw Simplistic Tables
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Apr 18, 2020
1 parent d663282 commit b44b8ff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions views/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,20 @@ func ViewUsersTable(users []*auth.ExportedUserRecord, nextPageToken string) {
os.Exit(1)
}
}

type TableUI interface {
AddLine(args ...interface{})
AddHeader(args ...interface{})
Print()
}

// SimpleTable returns a simple no interactable table to be printed to the terminal
func SimpleTableList(t TableUI, headers []interface{}, rows ...[]interface{}) TableUI {
if headers != nil {
t.AddHeader(headers...)
}
for _, v := range rows {
t.AddLine(v...)
}
return t
}

0 comments on commit b44b8ff

Please sign in to comment.