diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2020-10-26 19:07:47 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2020-10-26 19:07:47 +0100 |
commit | 0c1a8d990204f667d860a97da3f445a4d48bc245 (patch) | |
tree | 8939bfe8b0759d40d40e83c3d78ca9d9921a9771 | |
parent | cc59fcfb41e656fda83add05b11d4db244f41199 (diff) | |
download | sdn-0c1a8d990204f667d860a97da3f445a4d48bc245.tar.gz sdn-0c1a8d990204f667d860a97da3f445a4d48bc245.tar.xz sdn-0c1a8d990204f667d860a97da3f445a4d48bc245.zip |
Implement the --version option
Since we have a version number at all, even if it's meaningless.
-rw-r--r-- | sdn.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |