diff --git a/src/testmains/Makefile.am b/src/testmains/Makefile.am index 0c22e234..d4f5afd1 100644 --- a/src/testmains/Makefile.am +++ b/src/testmains/Makefile.am @@ -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 diff --git a/src/testmains/trpathut.cpp b/src/testmains/trpathut.cpp new file mode 100644 index 00000000..9dba4898 --- /dev/null +++ b/src/testmains/trpathut.cpp @@ -0,0 +1,49 @@ +#include "pathut.h" + +#include +#include + +#include + +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; +}