Closed omythic closed 6 months ago
I've added a -O, --ordered Mappings preserve key order
option.
You can also use an environment variable:
$ ys --load --ordered --yaml file.ys
$ YS_ORDERED=1 ys --load --yaml file.ys
For now when using a binding like Python's you'll need to set the environment variable to get this behavior.
@omythic
To test this PR:
git clone https://github.com/yaml/yamlscript
cd yamlscript
git checkout ingy/issue-121
make install
ys --help # should show `--ordered`
That works for me @ingydotnet ! Awesome, thank you. Turned that around so fast.
AFAIK clojure does not support preserving key order in its standard hash type. This is awkward for cases where one needs to preserve key order in output YAML -- can that be made possible?