pulumi/pkg/engine/config_list.go
Matt Ellis 5ae02ad581 Remove use of ambient stdout/stderr streams
Instead of talking directly to stdout or stderr via methods on fmt,
indirect through an Engine type (presently a global, but soon to
change) to allow control of where the streams actually end up.
2017-08-24 18:00:46 -07:00

25 lines
538 B
Go

package engine
import (
"fmt"
"github.com/pulumi/pulumi-fabric/pkg/tokens"
)
func ListConfig(envName string) error {
info, err := initEnvCmdName(tokens.QName(envName), "")
if err != nil {
return err
}
config := info.Target.Config
if config != nil {
fmt.Fprintf(E.Stdout, "%-32s %-32s\n", "KEY", "VALUE")
for _, key := range info.Target.Config.StableKeys() {
v := info.Target.Config[key]
// TODO[pulumi/pulumi-fabric#113]: print complex values.
fmt.Fprintf(E.Stdout, "%-32s %-32s\n", key, v)
}
}
return nil
}