Implement the --version option

Since we have a version number at all, even if it's meaningless.
This commit is contained in:
Přemysl Eric Janouch 2020-10-26 19:07:47 +01:00
parent cc59fcfb41
commit 0c1a8d9902
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 5 additions and 0 deletions

View File

@ -1720,6 +1720,11 @@ fun save_config () {
}
int main (int argc, char *argv[]) {
if (argc == 2 && string (argv[1]) == "--version") {
cout << PROJECT_NAME << " " << PROJECT_VERSION << endl;
return 0;
}
// zsh before 5.4 may close stdin before exec without redirection,
// since then it redirects stdin to /dev/null
(void) close (STDIN_FILENO);