\IM{--help} \c{--help} command-line option
\IM{--version} \c{--version} command-line option
\IM{--licence} \c{--licence} command-line option
+\IM{--list-charsets} \c{--list-charsets} command-line option
\IM{--precise} \c{--precise} command-line option
\IM{command syntax} commands, general syntax of
You can specify any well-known name for any supported character set.
For example, \c{iso-8859-1}, \c{iso8859-1} and \c{iso_8859-1} are
all recognised, \c{GB2312} and \c{EUC-CN} both work, and so on.
+(You can list character sets known to Halibut with by invoking it
+with the \cw{--list-charsets} option; see \k{running-options}.)
This directive takes effect immediately after the \c{\\cfg} command.
All text after that until the end of the input file is expected to be
\dd Changes the assumed character set for input files from the
default of ASCII.
+\dt \cw{--list-charsets}
+
+\dd Makes Halibut list character sets known to it.
+
\dt \cw{--precise}
\dd Makes Halibut report the column number as well as the line
}
+\dt \I{character sets, enumerating}\i\cw{--list-charsets}
+
+\dd List character sets known to Halibut.
+
\dt \i\cw{--help}
\dd Print a brief help message and exit immediately. (Don't confuse
void help(void);
void usage(void);
void showversion(void);
+void listcharsets(void);
/*
* licence.c
" --pdf[=filename] generate PDF output",
" -Cfoo:bar:baz append \\cfg{foo}{bar}{baz} to input",
" --input-charset=cs change default input file charset",
+ " --list-charsets display supported character set names",
" --precise report column numbers in error messages",
" --help display this text",
" --version display version number",
void showversion(void) {
printf("Halibut, %s\n", version);
}
+
+void listcharsets(void) {
+ int i = 0, c;
+ do {
+ c = charset_localenc_nth(i);
+ if (c == CS_NONE) break;
+ printf("%s\n", charset_to_localenc(c));
+ i++;
+ } while (1);
+}
!strcmp(opt, "-license")) {
licence();
nogo = TRUE;
+ } else if (!strcmp(opt, "-list-charsets")) {
+ listcharsets();
+ nogo = TRUE;
} else if (!strcmp(opt, "-precise")) {
reportcols = 1;
} else {