+VERSION=1.0
+
PCRE_CFLAGS:=$(shell pcre-config --cflags)
PCRE_LIBS:=$(shell pcre-config --libs)
-CFLAGS=-O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wredundant-decls -std=gnu99 $(PCRE_CFLAGS) -g
+CFLAGS=-O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wredundant-decls -std=gnu99 $(PCRE_CFLAGS) -DVERSION='"$(VERSION)"'
LDLIBS=$(PCRE_LIBS)
all: xsv xsv.1
./run-tests
xsv.1: xsv.1.txt
- a2x -f manpage $<
+ a2x -f manpage -a xsvversion=$(VERSION) $<
clean:
rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core -or -name .depend -or -name .#*`
enum long_options {
OPT_HELP = 256,
+ OPT_VERSION,
OPT_TRIM,
OPT_ALWAYS_QUOTE,
OPT_TABLE,
{ "fs", 1, NULL, 'd' },
{ "grid", 0, NULL, OPT_GRID },
{ "header", 0, NULL, 'h' },
+ { "help", 0, NULL, OPT_HELP },
{ "quiet", 0, NULL, 'q' },
{ "regex", 1, NULL, 'r' },
{ "sloppy", 0, NULL, 's' },
{ "table-sep", 1, NULL, OPT_TABLE_SEP },
{ "trim", 0, NULL, OPT_TRIM },
{ "tsv", 0, NULL, 't' },
+ { "version", 0, NULL, OPT_VERSION },
{ "ws", 0, NULL, 'w' },
- { "help", 0, NULL, OPT_HELP },
{ NULL, 0, NULL, 0 },
};
break;
case OPT_HELP:
usage();
+ case OPT_VERSION:
+ puts("This is xsv version " VERSION ".");
+ exit(0);
case OPT_TRIM:
want_trim = 1;
break;