mirror of
https://github.com/mikefarah/yq.git
synced 2025-02-05 15:37:02 +00:00
minor updates
This commit is contained in:
parent
732a1e33d5
commit
9e323701e4
@ -65,8 +65,8 @@ yq -P sample.json
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
rootCmd.PersistentFlags().StringVarP(&outputFormat, "output-format", "o", "auto", "[auto|a|yaml|y|json|j|props|p|xml|x] output format type.")
|
rootCmd.PersistentFlags().StringVarP(&outputFormat, "output-format", "o", "auto", "[auto|a|yaml|y|json|j|props|p|xml|x|tsv|t|csv|c] output format type.")
|
||||||
rootCmd.PersistentFlags().StringVarP(&inputFormat, "input-format", "p", "auto", "[auto|a|yaml|y|props|p|xml|x|toml] parse format for input. Note that json is a subset of yaml.")
|
rootCmd.PersistentFlags().StringVarP(&inputFormat, "input-format", "p", "auto", "[auto|a|yaml|y|props|p|xml|x|tsv|t|csv|c|toml] parse format for input. Note that json is a subset of yaml.")
|
||||||
|
|
||||||
rootCmd.PersistentFlags().StringVar(&yqlib.ConfiguredXMLPreferences.AttributePrefix, "xml-attribute-prefix", yqlib.ConfiguredXMLPreferences.AttributePrefix, "prefix for xml attributes")
|
rootCmd.PersistentFlags().StringVar(&yqlib.ConfiguredXMLPreferences.AttributePrefix, "xml-attribute-prefix", yqlib.ConfiguredXMLPreferences.AttributePrefix, "prefix for xml attributes")
|
||||||
rootCmd.PersistentFlags().StringVar(&yqlib.ConfiguredXMLPreferences.ContentName, "xml-content-name", yqlib.ConfiguredXMLPreferences.ContentName, "name for xml content (if no attribute name is present).")
|
rootCmd.PersistentFlags().StringVar(&yqlib.ConfiguredXMLPreferences.ContentName, "xml-content-name", yqlib.ConfiguredXMLPreferences.ContentName, "name for xml content (if no attribute name is present).")
|
||||||
|
@ -95,25 +95,7 @@ func (dec *propertiesDecoder) applyProperty(context Context, properties *propert
|
|||||||
|
|
||||||
rhsNode.Tag = guessTagFromCustomType(rhsNode)
|
rhsNode.Tag = guessTagFromCustomType(rhsNode)
|
||||||
|
|
||||||
rhsCandidateNode := &CandidateNode{
|
return dec.d.DeeplyAssign(context, path, rhsNode)
|
||||||
Path: path,
|
|
||||||
Node: rhsNode,
|
|
||||||
}
|
|
||||||
|
|
||||||
assignmentOp := &Operation{OperationType: assignOpType, Preferences: assignPreferences{}}
|
|
||||||
|
|
||||||
rhsOp := &Operation{OperationType: referenceOpType, CandidateNode: rhsCandidateNode}
|
|
||||||
|
|
||||||
assignmentOpNode := &ExpressionNode{
|
|
||||||
Operation: assignmentOp,
|
|
||||||
LHS: createTraversalTree(path, traversePreferences{}, false),
|
|
||||||
RHS: &ExpressionNode{Operation: rhsOp},
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err := dec.d.GetMatchingNodes(context, assignmentOpNode)
|
|
||||||
// toml?
|
|
||||||
// return dec.d.DeeplyAssign(context, path, rhsNode)
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dec *propertiesDecoder) Decode() (*CandidateNode, error) {
|
func (dec *propertiesDecoder) Decode() (*CandidateNode, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user