]> mj.ucw.cz Git - xsv.git/blobdiff - xsv.c
Man page: Fixed a couple of formatting typos
[xsv.git] / xsv.c
diff --git a/xsv.c b/xsv.c
index b11946c7c1b92aa47d91de00ddfccc453609199a..b815c7205a774d09d88335496bde4bc7b38c584a 100644 (file)
--- a/xsv.c
+++ b/xsv.c
@@ -4,8 +4,6 @@
  *     (c) 2012 Martin Mares <mj@ucw.cz>
  */
 
-#define _GNU_SOURCE
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -871,6 +869,7 @@ static const char short_options[] = "cd:f:hqr:twW";
 
 enum long_options {
        OPT_HELP = 256,
+       OPT_VERSION,
        OPT_TRIM,
        OPT_ALWAYS_QUOTE,
        OPT_TABLE,
@@ -887,6 +886,7 @@ static const struct option long_options[] = {
        { "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' },
@@ -894,8 +894,8 @@ static const struct option long_options[] = {
        { "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 },
 };
 
@@ -1001,6 +1001,9 @@ int main(int argc, char **argv)
                                break;
                        case OPT_HELP:
                                usage();
+                       case OPT_VERSION:
+                               puts("This is xsv version " VERSION ".");
+                               exit(0);
                        case OPT_TRIM:
                                want_trim = 1;
                                break;