Fix -r flag in gen-version.sh

Review 1909 by @larkost