sensu-plugins / sensu-plugins-opsgenie

Sensu plugins for OpsGenie
http://sensu-plugins.io
MIT License
4 stars 24 forks source link

JSON argument validation #13

Open dizzythinks opened 8 years ago

dizzythinks commented 8 years ago

Yesterday, I noticed the change between 0.0.3 and 1.0.0 regarding the 'j|--json argument. I was previously specifying a file and it took me a little while to figure out why it was no longer working.

Is it worth adding a validation step that gives a meaningful error if someone passes a file instead of a json key i.e. link to the changelog?

I've got a branch with this working, although I'm not a ruby guy per se so its probably not the best way to do it, plus I see for PR it requires tests etc, not sure how these are done.

https://github.com/dizzythinks/sensu-plugins-opsgenie/tree/check_argument

If this is something worth putting a PR in for in your view let me know.

majormoses commented 6 years ago

Sorry for no one reaching out sooner, this seems like a very reasonable solution. If you could rebase and PR it that would be awesome.