mirror of
https://github.com/mikefarah/yq.git
synced 2026-08-24 16:39:58 +08:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a419aad6 | ||
|
|
deee3c1f60 | ||
|
|
4c47f43251 | ||
|
|
3c7ccf0bc4 | ||
|
|
e16167ff26 | ||
|
|
eaeeffe417 | ||
|
|
4b0cd5335b | ||
|
|
60b4840a20 | ||
|
|
8c512dcc40 | ||
|
|
cdd2a90a98 | ||
|
|
2529a4708a | ||
|
|
277ba1fe5d | ||
|
|
2c4bd03ec6 | ||
|
|
d105efbcf1 | ||
|
|
9c6d84d184 | ||
|
|
e869f4b81f | ||
|
|
a72743f9c9 | ||
|
|
0881ce2476 | ||
|
|
4d9583d1ee |
+1
-1
@@ -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] parse format for input. Note that json is a subset of yaml.")
|
||||
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().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).")
|
||||
|
||||
@@ -5,6 +5,8 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
// "strings"
|
||||
"unicode"
|
||||
|
||||
"golang.org/x/net/html/charset"
|
||||
|
||||
@@ -49,10 +49,12 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user