From 7b358424ebad9349421acd533c2fa1cbf6cf3e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 28 Dec 2016 16:52:56 +0100 Subject: Initial import of xtrkcad version 1:4.0.2-2 --- app/tools/halibut/help.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 app/tools/halibut/help.c (limited to 'app/tools/halibut/help.c') diff --git a/app/tools/halibut/help.c b/app/tools/halibut/help.c new file mode 100644 index 0000000..8db2859 --- /dev/null +++ b/app/tools/halibut/help.c @@ -0,0 +1,56 @@ +/* + * help.c: usage instructions + */ + +#include +#include "halibut.h" + +static const char *const helptext[] = { + "usage: halibut [options] files", + "options: --text[=filename] generate plain text output", + " --html[=filename] generate XHTML output", + " --winhelp[=filename] generate 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", + " --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); +} -- cgit v1.2.3