File: help.c

package info (click to toggle)
halibut 1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,084 kB
  • sloc: ansic: 58,429; makefile: 294; perl: 194; lisp: 76; sh: 21
file content (58 lines) | stat: -rw-r--r-- 1,798 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * help.c: usage instructions
 */

#include <stdio.h>
#include "halibut.h"

static const char *const helptext[] = {
    "usage:   halibut [options] files",
    "options: --text[=filename]     generate plain text output",
    "         --html[=filename]     generate HTML or XHTML output",
    "         --chm[=filename]      generate Windows HTML Help output",
    "         --winhelp[=filename]  generate legacy Windows Help output",
    "         --man[=filename]      generate man page output",
    "         --info[=filename]     generate GNU info output",
    "         --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",
    "         --licence             display licence text",
    NULL
};

static const char *const usagetext[] = {
    "usage: halibut [--format[=filename]] [options] file.but [file.but...]",
    NULL
};

void help(void) {
    const char *const *p;
    for (p = helptext; *p; p++)
	puts(*p);
}

void usage(void) {
    const char *const *p;
    for (p = usagetext; *p; p++)
	puts(*p);
}

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);
}