Skip to content

Commit

Permalink
Add basic display
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Sep 5, 2020
1 parent 2660d57 commit 0d00587
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions internal/display/display.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package display

import (
"fmt"
"io"
"strings"

"github.com/auth0/auth0-cli/internal/ansi"
"github.com/cyx/auth0/management"
)

type Renderer struct {
Tenant string

Writer io.Writer
}

func (r *Renderer) ActionList(actions []*management.Action) {
r.Heading(ansi.Bold(r.Tenant), "actions")

for _, a := range actions {
fmt.Fprintf(r.Writer, "%s\n", a.Name)
}
}

func (r *Renderer) Heading(text ...string) {
fmt.Fprintf(r.Writer, "%s %s\n", ansi.Faint("==="), strings.Join(text, " "))
}

0 comments on commit 0d00587

Please sign in to comment.