retrieve MAD-X version

I think there should be a way to retrieve the MAD-X version programmatically. If possible the revision number would be even better.