...

Text file src/cuelang.org/go/doc/tutorial/kubernetes/quick/services/ls_tool.cue

Documentation: cuelang.org/go/doc/tutorial/kubernetes/quick/services

     1package kube
     2
     3import (
     4	"text/tabwriter"
     5	"tool/cli"
     6	"tool/file"
     7)
     8
     9command: ls: {
    10	task: print: cli.Print & {
    11		text: tabwriter.Write([
    12			for x in objects {
    13				"\(x.kind)  \t\(x.metadata.labels.component)  \t\(x.metadata.name)"
    14			},
    15		])
    16	}
    17
    18	task: write: file.Create & {
    19		filename: "foo.txt"
    20		contents: task.print.text
    21	}
    22}

View as plain text