alex-courtis/way-displays

Invalid YAML with `-y` option

justinlovinger opened this issue · 6 comments

Calling way-displays -y -g provides invalid YAML because the INFO key is duplicated in MESSAGES. Some YAML parsers will fail to parse way-displays -y -g.

I've only ever used yq and yaml-cpp to parse it; apologies for the duplicates.

It might be best to just remove messages from the YAML output; they are really only for the human output.

I've only ever used yq and yaml-cpp to parse it; apologies for the duplicates.

No problem. I was able to work around the issue by converting the YAML to valid JSON using yq.

It might be best to just remove messages from the YAML output; they are really only for the human output.

I agree. The -y output should be easily parsable, which the messages are not, and the messages contain redundant information.

This is great, thank you. Tracking at #109

Fixed on master.

@justinlovinger I would be grateful if you could test:

git clone git@github.com:alex-courtis/way-displays.git
cd way-displays
git submodule update --init
make
sudo make install

When you are done you can

sudo make uninstall

MESSAGES are now a sequence of maps by log level and only warnings/errors are present.