/*====================================================================
 *
 * TXF help module
 *
 *====================================================================
 *                                   copyright(C) 1992-1994 T.Nakatani
 *====================================================================
 */
#include "txf.h"

void errexit(char *errmes)
{
	fprintf(stderr, "\nError:%s\n", errmes);
	exit(1);
}

void logicerr(char *str)
{
	if (str != NULL) {
		fprintf(stderr, "\nError:%s", str);
	}
	errexit("This is TXF's logical BUG. Prease contact T.Nakatani(PFG02442)");
}

#if !NOHELP

void credit(char *name)
{
	int i = 0;
	char *str[30] = {
	"[@filename]       commandfile",
	"[-a]              All switch(es) init.",
	"[-b [pos]]        notice Base position",
	"[-c value]        Centering",
	"[-d]              temporary Directory",
	"[-e old [new]]    Exchange strings",
	"[-ex]             eXecute Exchanges",
	"[-f [start[end]]] Format",
	"[-fx[start[end]]] eXecute Format",
	"[-h & -?]         show Help",
	"[-i][filename]    Input filename",
	"[-io wildcard]    In/Out filename",
	"[-k{f|l} strings] Kinsoku characters",
	"[-kq strings]     Quote characters",
	"[-l maxpos]       set Line length",
	"[-ml pos]         set Left  Margin",
	"[-mr pos]         set Right Margin",
	"[-n value]        No format",
	"[-o filename2]    Output filename",
	"[-p]              Prohibit halfsize gap",
	"[-q]              understand Quotation",
	"[-r]              add Return code",
	"[-rb]             Remove .BAK file",
	"[-rz]             Remove ctrl-Z",
	"[-s character]    Separate character",
	"[-t size]         set Tabsize",
	"[-v[mode]]        set Viewmode",
	"[-x]              eXpand tabcode",
	NULL, NULL};

	fprintf(stderr, "OPTION:\n");
	while (str[i] != NULL) {
		fprintf(stderr, "%-40s%s\n", str[i], str[i+1]);
		i += 2;
	}

	exit(0);
}
/*
void showswitch()
{
	char *env;
	if ((env = getenv("TXF")) != NULL) {
		if (strcmp(env,"TEST") == 0) {
			printf("-l   %2d  -mr  %2d  -ml  %2d  -c   %2d  -v   %2d\n", maxc, left, right, cent, viewmode);
			printf("-ish %2d\n", ishflg);
			printf("\n");
		}
	}
}
*/
#endif

