Make ps_glyph_to_unicode() take a glyph index instead of a glyph name.
[sgt/halibut] / help.c
CommitLineData
d7482997 1/*
2 * help.c: usage instructions
3 */
4
5#include <stdio.h>
6#include "halibut.h"
7
fbe8cf20 8static const char *const helptext[] = {
bc7e2a4b 9 "usage: halibut [options] files",
10 "options: --text[=filename] generate plain text output",
11 " --html[=filename] generate XHTML output",
12 " --winhelp[=filename] generate Windows Help output",
13 " --man[=filename] generate man page output",
59ddc51d 14 " --info[=filename] generate GNU info output",
43341922 15 " --ps[=filename] generate PostScript output",
16 " --pdf[=filename] generate PDF output",
bc7e2a4b 17 " -Cfoo:bar:baz append \\cfg{foo}{bar}{baz} to input",
675958c3 18 " --input-charset=cs change default input file charset",
f336fa9a 19 " --list-charsets display supported character set names",
bc7e2a4b 20 " --precise report column numbers in error messages",
21 " --help display this text",
22 " --version display version number",
23 " --licence display licence text",
d7482997 24 NULL
25};
26
fbe8cf20 27static const char *const usagetext[] = {
675958c3 28 "usage: halibut [--format[=filename]] [options] file.but [file.but...]",
d7482997 29 NULL
30};
31
32void help(void) {
fbe8cf20 33 const char *const *p;
d7482997 34 for (p = helptext; *p; p++)
35 puts(*p);
36}
37
38void usage(void) {
fbe8cf20 39 const char *const *p;
d7482997 40 for (p = usagetext; *p; p++)
41 puts(*p);
42}
43
44void showversion(void) {
45 printf("Halibut, %s\n", version);
46}
f336fa9a 47
48void listcharsets(void) {
49 int i = 0, c;
50 do {
51 c = charset_localenc_nth(i);
52 if (c == CS_NONE) break;
53 printf("%s\n", charset_to_localenc(c));
54 i++;
55 } while (1);
56}