Compare commits

..
Author SHA1 Message Date
Mike Farah d3bf3056c5 Lint 2022-01-15 11:54:18 +11:00
Mike Farah 3b3f7dc08a Improve yq doc 2022-01-15 11:51:37 +11:00
Mike Farah a6a4f69ccb Minor fixes 2022-01-15 11:48:22 +11:00
Mike Farah be36a0ef4b Added XML encoding/decoding 2022-01-15 11:44:52 +11:00
3 changed files with 1 additions and 5 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ See https://mikefarah.gitbook.io/yq/ for detailed documentation and examples.`,
}
rootCmd.PersistentFlags().StringVarP(&outputFormat, "output-format", "o", "yaml", "[yaml|y|json|j|props|p|xml|x] output format type.")
rootCmd.PersistentFlags().StringVarP(&inputFormat, "input-format", "p", "yaml", "[yaml|y|xml|x] input format type. Note that json is a subset of yaml.")
rootCmd.PersistentFlags().StringVarP(&inputFormat, "input-format", "p", "yaml", "[yaml|y|xml|x] parse format for input. Note that json is a subset of yaml.")
rootCmd.PersistentFlags().StringVar(&xmlAttributePrefix, "xml-attribute-prefix", "+", "prefix for xml attributes")
rootCmd.PersistentFlags().StringVar(&xmlContentName, "xml-content-name", "+content", "name for xml content (if no attribute name is present).")
-2
View File
@@ -5,8 +5,6 @@ import (
"fmt"
"io"
"strings"
// "strings"
"unicode"
"golang.org/x/net/html/charset"
-2
View File
@@ -49,12 +49,10 @@ func (e *xmlEncoder) Encode(writer io.Writer, node *yaml.Node) error {
return err
}
case yaml.DocumentNode:
log.Debugf("ENCODING DOCUMENT NODE")
err := e.encodeComment(encoder, headAndLineComment(node))
if err != nil {
return err
}
log.Debugf("OK NOW THE ACTUAL")
err = e.encodeTopLevelMap(encoder, unwrapDoc(node))
if err != nil {
return err