Commit Graph

95 Commits

Author SHA1 Message Date
Mike Farah
85d059340b first cli 2020-10-27 16:45:16 +11:00
Morgan Bazalgette
bb9cb0c60e fix tests 2020-10-09 08:38:42 +11:00
Mike Farah
b9e304e7a4 Can stripComments and explodeAnchors for compare 2020-06-11 09:13:55 +10:00
Mike Farah
63313ebb02 Merge branch 'coryrc-fix-merge-with-dots' into compare 2020-02-07 09:10:25 +11:00
Mike Farah
de3bfaef60 Merge branch 'fix-merge-with-dots' of git://github.com/coryrc/yq into coryrc-fix-merge-with-dots 2020-02-07 09:09:52 +11:00
Mike Farah
108b5cb093 Fixed explode for simple anchors 2020-02-07 09:08:52 +11:00
Cory Cross
ea9df0eede Fix path generation when merging file has period in key
The program generates a path for every leaf node in the
file-to-be-merged. It does not escape them if they contain a dot, as
the path-expressions document mentions is necessary.

Add in a test for this condition. Verified it fails without the fix.
2020-02-04 22:37:00 -08:00
Mike Farah
14ac791eaf Fixed compare output, added tests 2020-02-03 15:35:00 +11:00
Mike Farah
6ec8386f9e Fixed bad yaml handling 2020-01-30 16:32:28 +11:00
Mike Farah
d203ec7b56 Accidently changed sample.yaml 2020-01-15 08:55:01 +11:00
Mike Farah
2d7be26ad5 wip update docs 2020-01-13 16:58:11 +11:00
Mike Farah
2d237e7e8e it works! wip 2020-01-11 19:13:52 +11:00
Mike Farah
74c7a4e027 it works! wip 2020-01-11 18:52:15 +11:00
Mike Farah
96955ffa9c release notes 2020-01-11 09:55:24 +11:00
Mike Farah
854f5f0fc9 wip json encoding 2020-01-10 22:01:59 +11:00
Mike Farah
690da9ee74 Fixed merge new array 2020-01-06 10:12:30 +13:00
Mike Farah
1f7f1b0def Merge arrays! 2020-01-05 17:28:24 +13:00
Mike Farah
1aa5ec1d40 Merge! wip 2020-01-05 17:14:14 +13:00
Mike Farah
cf389bed4a Refactor wip 2019-12-27 19:06:08 +11:00
Mike Farah
ff5b23251b Refactor wip 2019-12-25 12:11:04 +11:00
Mike Farah
949bf1c1d7 Merge anchors - wip 2019-12-22 15:15:15 +11:00
Mike Farah
19fe718cfb Aliases! 2019-12-16 21:09:23 +11:00
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