Commit Graph

73 Commits

Author SHA1 Message Date
Mike Farah 290579ac7f Handle simple aliases 2019-12-16 20:38:55 +11:00
Mike Farah a3cebec2fd Added prefix command 2019-12-16 16:17:01 +11:00
Mike Farah 53a4a47ce3 wip - prefix splat 2019-12-15 18:38:40 +11:00
Mike Farah 5988d0cffa Simplified 2019-12-15 18:24:23 +11:00
Mike Farah d061b2f9f9 Can delete arrays 2019-12-12 20:47:22 +11:00
Mike Farah 586ffb833b Refactoring 2019-12-09 13:57:10 +11:00
Mike Farah 9771e7001c splatting 2019-12-09 13:44:53 +11:00
Mike Farah 972e2b9575 wip 2019-12-06 16:36:42 +11:00
Mike Farah aad15ccc6e better v3 2019-12-06 15:57:46 +11:00
Mike Farah 84de9c078d Improved handling of numeric keys
When there is no match at a given path, numeric keys are assumed to be strings.
To create an array '+' must be used.

e.g: yq n thing[+].cat fred
will create an array under thing, whereas
yq n thing[0].cat fred
will create a map under thing, with a key '0'
2019-05-16 10:03:54 +10:00
Mike Farah c4e9516aa6 Prefix matching splat
Fixes https://github.com/mikefarah/yq/issues/218
2019-05-13 09:32:08 +10:00
Mike Farah 323089eb64 fixed tests for write array splat 2019-05-13 09:13:45 +10:00
Renzo Crisóstomo 23543ee031 Add test for --allow-empty flag in merge command 2019-03-22 09:13:39 +11:00
Mike Farah 86b9fe3ef9 Can read from all documents 2018-07-08 21:47:01 +10:00
Mike Farah 2c15048ddb Added merge with append 2018-07-07 15:26:56 +10:00
Mike Farah 25c9c22d8d Updating docs 2018-06-20 14:29:17 +10:00
Mike Farah fb87f638f2 Multi doc supports updating all docs 2018-06-20 11:45:51 +10:00
Mike Farah c38f19e0a9 Enabled multi document support for merge (first document only) 2018-06-15 16:48:36 +10:00
Mike Farah 06a843e9b2 Read now handles multiple documents 2018-06-12 15:41:09 +10:00
Mike Farah ee8ffd458a Multiline value fix - multi line strings no longer printed as a yaml block
Although printing the string as a yaml block can be argued to be technically correct, in practical terms it's more useful to just print out the multiline string as is.
2018-03-27 16:22:24 +11:00
kenjones 51fa1a87b7 Bugfix: Read yaml array
Parsing an array into MapSlice results in `[{nil, nil}]`.
Parse into `[]map[interface{}]interface{}` allows for the processing of
top level arrays in the document.

Resolves: #23
2017-09-23 13:53:04 -04:00
kenjones 6980be3800 Feature: Adds merge command
Adds merge command for merging multiple yaml files together.

Resolves: #31
2017-09-23 14:45:59 +10:00
kenjones 86639acf70 Task: Simplify development
The base directory has all shell scripts in scripts/
and all example/test files in examples/.
A Makefile provides all the commands with helpful information.
If a developer simply types `make` then vendor is properly updated,
the code is formatted, linted, tested, built, acceptance test run,
and installed.

Linting errors resolved.
Ignored test case (`TestParsePath`) updated to work as expected.
2017-09-23 08:37:34 +10:00