Bug in utoi(), which made it ignore a leading minus sign when
[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",
62a4b06b 20 " --list-fonts display supported font names",
bc7e2a4b 21 " --precise report column numbers in error messages",
22 " --help display this text",
23 " --version display version number",
24 " --licence display licence text",
d7482997 25 NULL
26};
27
fbe8cf20 28static const char *const usagetext[] = {
675958c3 29 "usage: halibut [--format[=filename]] [options] file.but [file.but...]",
d7482997 30 NULL
31};
32
33void help(void) {
fbe8cf20 34 const char *const *p;
d7482997 35 for (p = helptext; *p; p++)
36 puts(*p);
37}
38
39void usage(void) {
fbe8cf20 40 const char *const *p;
d7482997 41 for (p = usagetext; *p; p++)
42 puts(*p);
43}
44
45void showversion(void) {
46 printf("Halibut, %s\n", version);
47}
f336fa9a 48
49void listcharsets(void) {
50 int i = 0, c;
51 do {
52 c = charset_localenc_nth(i);
53 if (c == CS_NONE) break;
54 printf("%s\n", charset_to_localenc(c));
55 i++;
56 } while (1);
57}