alex-courtis / way-displays

way-displays: Auto Manage Your Wayland Displays
MIT License
240 stars 12 forks source link

Invalid YAML with `-y` option #107

Closed justinlovinger closed 10 months ago

justinlovinger commented 1 year ago

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.

alex-courtis commented 1 year ago

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.

justinlovinger commented 1 year ago

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.

alex-courtis commented 1 year ago

This is great, thank you. Tracking at #109

alex-courtis commented 11 months ago

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
alex-courtis commented 11 months ago

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

alex-courtis commented 10 months ago

Done: #123