Skip to content

Commit

Permalink
cmd/pipeline: enable verbose printing during listing
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Worm <tony@hofstadter.io>
  • Loading branch information
verdverm committed Jan 26, 2022
1 parent 350c53f commit 87f4215
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pipeline/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/hofstadter-io/cuetils/cmd/cuetils/flags"
"github.com/hofstadter-io/cuetils/pipeline/tasks/pipe"
"github.com/hofstadter-io/cuetils/structural"
"github.com/hofstadter-io/cuetils/utils"
)

func Run(globs []string, opts *flags.RootPflagpole, popts *flags.PipelineFlagpole) ([]structural.GlobResult, error) {
Expand Down Expand Up @@ -234,14 +235,19 @@ func listPipelines(val cue.Value, opts *flags.RootPflagpole, popts *flags.Pipel
for _, attr := range attrs {
if attr.Name() == "pipeline" {
if len(args) == 0 || matchPipeline(attr, args) {
fmt.Println(attr)
if popts.Docs {
docs := v.Doc()
s := ""
docs := v.Doc()
for _, d := range docs {
s += d.Text()
}
fmt.Println(s)
fmt.Print(s)
}
if opts.Verbose {
s, _ := utils.FormatCue(v)
fmt.Printf("%s: %s\n", v.Path(), s)
} else {
fmt.Println(attr)
}
}
return false
Expand Down

0 comments on commit 87f4215

Please sign in to comment.