aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/svnversion/svnversion.cpp
blob: 1e9fc976689da0555e55ca15bd275e5e7a19c1ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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