aboutsummaryrefslogtreecommitdiff
path: root/test/postinstall/testappprojinfo/testappprojinfo.c
blob: 64b5d66555ef1ee3e7c2c7002d94cf2b276edada (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include <proj.h>

int main(int argc, char *argv[]) {
    PJ_INFO info;
    info = proj_info();
    if(argc == 2 && argv[1][0] == '-') {
        switch(argv[1][1]) {
            case 's':
                printf("%s\n", info.searchpath);
                return(0);
            case 'v':
                printf("%d.%d.%d\n", info.major, info.minor, info.patch);
                return(0);
        }
    }
    printf("Use option -v or -s\n");
    return(1);
}