From 0c1a8d990204f667d860a97da3f445a4d48bc245 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Mon, 26 Oct 2020 19:07:47 +0100 Subject: Implement the --version option Since we have a version number at all, even if it's meaningless. --- sdn.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdn.cpp b/sdn.cpp index 1deb0fa..336e2e2 100644 --- a/sdn.cpp +++ b/sdn.cpp @@ -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); -- cgit v1.2.3-70-g09d2