/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
#if HAVE_CONFIG_H
static void usage(const char *prog)
{
- fprintf(stderr, "%s: [-c] [-n iterations] [-s] [infile]\n", prog);
+ fprintf(stderr, "%s: [-c] [-n iterations] [-s] [-S] [infile]\n", prog);
exit(1);
}
char *arg;
char *prog = argv[0];
int do_sortkeys = 0;
+ int do_strict = 0;
- while ((ret = options("cn:s", argv, argc, &arg)) != YAZ_OPTIONS_EOF)
+ while ((ret = options("cn:sS", argv, argc, &arg)) != YAZ_OPTIONS_EOF)
{
switch (ret)
{
case 's':
do_sortkeys = 1;
break;
+ case 'S':
+ do_strict = 1;
+ break;
default:
- usage(prog);
+ usage(prog);
}
}
cp = cql_parser_create();
+ cql_parser_strict(cp, do_strict);
if (fname)
{
int i;
if (do_sortkeys)
{
WRBUF w = wrbuf_alloc();
- r = cql_sortby_to_sortkeys(cql_parser_result(cp),
+ r = cql_sortby_to_sortkeys(cql_parser_result(cp),
wrbuf_vp_puts, w);
if (r == 0)
printf("sortkeys: %s\n", wrbuf_cstr(w));