cmd/input: list filters out \\n

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-05-31 15:21:39 +02:00
parent ba5078ef26
commit 91c2acd564

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"os" "os"
"strings"
"text/tabwriter" "text/tabwriter"
"go.dagger.io/dagger/client" "go.dagger.io/dagger/client"
@ -65,6 +66,8 @@ var listCmd = &cobra.Command{
valStr = fmt.Sprintf("%s (default)", valStr) valStr = fmt.Sprintf("%s (default)", valStr)
} }
valStr = strings.ReplaceAll(valStr, "\n", "\\n")
if !viper.GetBool("all") { if !viper.GetBool("all") {
// skip input that is not overridable // skip input that is not overridable
if !hasDefault && isConcrete { if !hasDefault && isConcrete {