summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorJacob Nevins <jacobn@chiark.greenend.org.uk>2005-02-18 13:17:28 +0000
committerJacob Nevins <jacobn@chiark.greenend.org.uk>2005-02-18 13:17:28 +0000
commit1fa5a06bb8ef61eb1a736641138221b1dc16b49e (patch)
treec94b1d4f8bd70c719594a1937c674e61274f2ad9 /help.c
parentf55620a931827ff666e910a7b1ce2b233738cf06 (diff)
downloadhalibut-1fa5a06bb8ef61eb1a736641138221b1dc16b49e.zip
halibut-1fa5a06bb8ef61eb1a736641138221b1dc16b49e.tar.gz
halibut-1fa5a06bb8ef61eb1a736641138221b1dc16b49e.tar.bz2
halibut-1fa5a06bb8ef61eb1a736641138221b1dc16b49e.tar.xz
Add a `--list-charsets' option to Halibut to enumerate canonical names of known
character sets. (Also make libcharset `return_in_enum' values saner.) [originally from svn r5341] [this svn revision also touched charset,filter,timber]
Diffstat (limited to 'help.c')
-rw-r--r--help.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/help.c b/help.c
index 7235032..e31f784 100644
--- a/help.c
+++ b/help.c
@@ -16,6 +16,7 @@ static char *helptext[] = {
" --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",
@@ -43,3 +44,13 @@ void usage(void) {
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);
+}