~mdw
/
sgt
/
halibut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revamp of the Halibut error handling mechanism.
[sgt/halibut]
/
help.c
diff --git
a/help.c
b/help.c
index
8104006
..
d65645d
100644
(file)
--- a/
help.c
+++ b/
help.c
@@
-5,7
+5,7
@@
#include <stdio.h>
#include "halibut.h"
#include <stdio.h>
#include "halibut.h"
-static c
har *
helptext[] = {
+static c
onst char *const
helptext[] = {
"usage: halibut [options] files",
"options: --text[=filename] generate plain text output",
" --html[=filename] generate XHTML output",
"usage: halibut [options] files",
"options: --text[=filename] generate plain text output",
" --html[=filename] generate XHTML output",
@@
-15,6
+15,9
@@
static char *helptext[] = {
" --ps[=filename] generate PostScript output",
" --pdf[=filename] generate PDF output",
" -Cfoo:bar:baz append \\cfg{foo}{bar}{baz} to input",
" --ps[=filename] generate PostScript output",
" --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",
+ " --list-fonts display supported font names",
" --precise report column numbers in error messages",
" --help display this text",
" --version display version number",
" --precise report column numbers in error messages",
" --help display this text",
" --version display version number",
@@
-22,19
+25,19
@@
static char *helptext[] = {
NULL
};
NULL
};
-static c
har *
usagetext[] = {
- "usage: halibut [--format[=filename]] [
-Cconfig...
] file.but [file.but...]",
+static c
onst char *const
usagetext[] = {
+ "usage: halibut [--format[=filename]] [
options
] file.but [file.but...]",
NULL
};
void help(void) {
NULL
};
void help(void) {
- c
har *
*p;
+ c
onst char *const
*p;
for (p = helptext; *p; p++)
puts(*p);
}
void usage(void) {
for (p = helptext; *p; p++)
puts(*p);
}
void usage(void) {
- c
har *
*p;
+ c
onst char *const
*p;
for (p = usagetext; *p; p++)
puts(*p);
}
for (p = usagetext; *p; p++)
puts(*p);
}
@@
-42,3
+45,13
@@
void usage(void) {
void showversion(void) {
printf("Halibut, %s\n", version);
}
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);
+}