Process help and version arguments before datadir.
Merge pull request #5351

3d0a1ce Process help and version arguments before datadir. (Pavel Janík)