1 /* liblouis Braille Translation and Back-Translation Library
3 Based on BRLTTY, copyright (C) 1999-2006 by
6 Copyright (C) 2004, 2005, 2006, 2009
7 ViewPlus Technologies, Inc. www.viewplus.com and
8 JJB Software, Inc. www.jjb-software.com
10 This program is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 Maintained by John J. Boyer john.boyer@jjb-software.com
36 #include "version-etc.h"
38 static const struct option longopts[] =
40 { "help", no_argument, NULL, 'h' },
41 { "version", no_argument, NULL, 'v' },
42 { "quiet", no_argument, NULL, 'q' },
46 const char version_etc_copyright[] =
47 "Copyright %s %d ViewPlus Technologies, Inc. and JJB Software, Inc.";
49 #define AUTHORS "John J. Boyer"
51 static int quiet_flag = 0;
57 Usage: %s [OPTIONS] TABLE[,TABLE,...]\n", program_name);
60 Test a Braille translation table. If the table contains errors,\n\
61 appropriate messages are displayed. If there are no errors the\n\
62 message \"no errors found.\" is shown unless you specify the --quiet\n\
66 -h, --help display this help and exit\n\
67 -v, --version display version information and exit\n\
68 -q, --quiet do not write to standard error if there are no errors.\n", stdout);
71 printf ("Report bugs to %s.\n", PACKAGE_BUGREPORT);
73 #ifdef PACKAGE_PACKAGER_BUG_REPORTS
74 printf ("Report %s bugs to: %s\n", PACKAGE_PACKAGER, PACKAGE_PACKAGER_BUG_REPORTS);
77 printf ("%s home page: <%s>\n", PACKAGE_NAME, PACKAGE_URL);
82 main (int argc, char **argv)
84 const TranslationTableHeader *table;
87 set_program_name (argv[0]);
89 while ((optc = getopt_long (argc, argv, "hvq", longopts, NULL)) != -1)
92 /* --help and --version exit immediately, per GNU coding standards. */
94 version_etc (stdout, program_name, PACKAGE_NAME, VERSION, AUTHORS, (char *) NULL);
105 fprintf (stderr, "Try `%s --help' for more information.\n",
111 if (optind != argc - 1)
113 /* Print error message and exit. */
114 if (optind < argc - 1)
115 fprintf (stderr, "%s: extra operand: %s\n",
116 program_name, argv[optind + 1]);
118 fprintf (stderr, "%s: no table specified\n",
120 fprintf (stderr, "Try `%s --help' for more information.\n",
125 if (!(table = lou_getTable (argv[optind])))
131 fprintf (stderr, "No errors found.\n");