feat: Add --merge option to CLI tool#611
Conversation
|
Do you have a use case for this that isn't solved by |
Well I'm not currently using old documents which I have no control over, if that's what you mean? But I don't want to be stuck on the This PR simply enables the existing Also, out of curiosity, why was the |
Yeah, a bit. I'd prefer to keep the CLI pretty minimal, rather than presuming that all the options it could have would have actual use. Regarding Are there other parses than
I'm afraid I wasn't around during that transition, so can't speak authoritatively. But as an implementer, it works very differently from anything else in the language and isn't really well defined. |
Not an ureasonable sentiment, but this is a single option, for a substantial feature—substantial in it's ability to cut down on a lot of duplicate config at least…
Which is exactly the kind of thing I'm getting at… I definitely don't want plain scalar
YAMLScript, and sometimes |
eemeli
left a comment
There was a problem hiding this comment.
I definitely don't want plain scalar
yes/noto ever be parsed as boolean, but do want to retain<<merge ability… So if the CLI is arbitrarily restricted to--yaml 1.1as the only way to enable the latter, I'm kind of screwed.
Ok, that makes sense. I added a couple more tests just to make sure the option was working as intended, but the code itself looks good.
yaml --single --merge --json < test.yaml{ "a": { "a": 2 }, "b": { "a": 2 } }