[main] Add a --version switch

We should have done this ages ago.

Fixes issue #660