static const struct option longopts[] =
{
{ "help", 0, 0, 'h' },
+ { "version", 0, 0, 'V' },
{ "columns", 0, 0, 'c' },
{ "table", 0, 0, 't' },
{ "separator", 0, 0, 's' },
fprintf(out, _(
" -h, --help displays this help text\n"
+ " -V, --version output version information and exit\n"
" -c, --columns <width> width of output in number of characters\n"
" -t, --table create a table\n"
" -s, --separator <string> table delimeter\n"
termwidth = win.ws_col;
tflag = xflag = 0;
- while ((ch = getopt_long(argc, argv, "h?c:s:tx", longopts, NULL)) != -1)
+ while ((ch = getopt_long(argc, argv, "hVc:s:tx", longopts, NULL)) != -1)
switch(ch) {
case 'h':
- case '?':
usage(EXIT_SUCCESS);
break;
+ case 'V':
+ printf(_("%s from %s\n"), program_invocation_short_name,
+ PACKAGE_STRING);
+ return(EXIT_SUCCESS);
case 'c':
termwidth = atoi(optarg);
break;