diff options
author | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/svnversion/svnversion.cpp |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/svnversion/svnversion.cpp')
-rw-r--r-- | library/cpp/svnversion/svnversion.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/library/cpp/svnversion/svnversion.cpp b/library/cpp/svnversion/svnversion.cpp new file mode 100644 index 00000000000..4c9761fa75c --- /dev/null +++ b/library/cpp/svnversion/svnversion.cpp @@ -0,0 +1,33 @@ +#include <string.h> +#include <stdlib.h> +#include <stdio.h> + +#define FROM_IMPL +#include "svnversion.h" + +#include <util/generic/strbuf.h> + +extern "C" void PrintProgramSvnVersion() { + puts(GetProgramSvnVersion()); +} + +extern "C" void PrintSvnVersionAndExit0() { + PrintProgramSvnVersion(); + exit(0); +} + +extern "C" void PrintSvnVersionAndExitEx(int argc, char* argv[], const char* opts) { + if (2 == argc) { + for (TStringBuf all = opts, versionOpt; all.NextTok(';', versionOpt);) { + if (versionOpt == argv[1]) { + PrintSvnVersionAndExit0(); + } + } + } +} + +extern "C" void PrintSvnVersionAndExit(int argc, char* argv[]) { + PrintSvnVersionAndExitEx(argc, argv, "--version"); +} + +#undef FROM_IMPL |