test prog

This commit is contained in:
Jean-Francois Dockes 2020-04-13 14:21:23 +02:00
parent 7987819415
commit fd53714906
2 changed files with 53 additions and 1 deletions

View File

@ -38,11 +38,14 @@ AM_CPPFLAGS = -Wall -Wno-unused -std=c++11 \
$(DEFS)
noinst_PROGRAMS = textsplit utf8iter fstreewalk rclconfig hldata unac mbox \
circache wipedir mimetype
circache wipedir mimetype pathut
textsplit_SOURCES = trtextsplit.cpp
textsplit_LDADD = ../librecoll.la
pathut_SOURCES = trpathut.cpp
pathut_LDADD = ../librecoll.la
mimetype_SOURCES = trmimetype.cpp
mimetype_LDADD = ../librecoll.la

View File

@ -0,0 +1,49 @@
#include "pathut.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
static const char *thisprog;
static int op_flags;
#define OPT_MOINS 0x1
#define OPT_r 0x2
#define OPT_s 0x4
static char usage [] =
"pathut\n"
;
static void
Usage(void)
{
fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
exit(1);
}
int main(int argc, const char **argv)
{
thisprog = argv[0];
argc--; argv++;
while (argc > 0 && **argv == '-') {
(*argv)++;
if (!(**argv))
/* Cas du "adb - core" */
Usage();
while (**argv)
switch (*(*argv)++) {
default: Usage(); break;
}
b1: argc--; argv++;
}
if (argc != 0)
Usage();
cout << "path_home() -> [" << path_home() << "]\n";
cout << "path_tildexpand(~) -> [" << path_tildexpand("~") << "]\n";
return 0;
}