Show the program version in the Help header.

1. On startup read the file git-rev if exists and initialize a new global
G_program_version.
2. In filechooser's help page's header show the version.
This helps to easily identify what version the user is running without
asking him to cat git-rev file manually.
This commit is contained in:
Tigran Aivazian
2012-10-07 12:59:37 +01:00
parent 1ced4ceb17
commit 87712cf0e4
2 changed files with 11 additions and 1 deletions

View File

@@ -99,6 +99,15 @@ if optarg["G"] ~= nil then
globalgamma = optarg["G"]
end
local vfile = io.open("git-rev", "r")
if vfile then
G_program_version = vfile:read("*a") or "?"
G_program_version = G_program_version:gsub("[\n\r]+", "")
vfile.close()
else
G_program_version = "(unknown version)"
end
if util.isEmulated()==1 then
input.open("")
-- SDL key codes