diff --git a/cmd/root.go b/cmd/root.go index b2b0bc6a..f3a00cf2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -65,8 +65,8 @@ yq -P sample.json 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(&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(&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|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.ContentName, "xml-content-name", yqlib.ConfiguredXMLPreferences.ContentName, "name for xml content (if no attribute name is present).") diff --git a/pkg/yqlib/decoder_properties.go b/pkg/yqlib/decoder_properties.go index a447b96a..e2438ee1 100644 --- a/pkg/yqlib/decoder_properties.go +++ b/pkg/yqlib/decoder_properties.go @@ -95,25 +95,7 @@ func (dec *propertiesDecoder) applyProperty(context Context, properties *propert rhsNode.Tag = guessTagFromCustomType(rhsNode) - rhsCandidateNode := &CandidateNode{ - 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 + return dec.d.DeeplyAssign(context, path, rhsNode) } func (dec *propertiesDecoder) Decode() (*CandidateNode, error) {