/******************************************************************************
 * This file is part of a software distribution, which is furnished under the *
 * terms of a license.  Use of this software  by any means is subject to this *
 * license  and  signifies  the  acceptance of  the  licensing  terms  stated *
 * therein. Please see  the file LICENSE in the  top-level directory  of this *
 * software  distribution  for detailed copyright  disclaimers  and licensing *
 * terms.                                                                     *
 ******************************************************************************
 * Copryight (c) by Andreas S. Wetzel - All rights reserved.                  *
 ******************************************************************************/

/* $Id: vd_usage.c,v 1.3 2001/03/19 19:32:56 mickey Exp $ */

#include <vchat.h>
#include <proto_vchatd.h>
#include <copyright.h>

extern char	*prog_name;

/*
 * void usage(char *fmt, ...);
 *
 * Print program usage information to stderr.
 */

void usage(char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);

	fprintf(stderr, "\n"); 
	fprintf(stderr, " ==============================================================================\n");
	fprintf(stderr, "          vchatd %s - %s / Protocol revision: %x-%x\n", VERSION, REL_DATE, MAJOR_REV(PROTO_REV), MINOR_REV(PROTO_REV));
	fprintf(stderr, "          %s\n", CPR1);
	fprintf(stderr, "          %s\n", CPR2);
	fprintf(stderr, " ==============================================================================\n\n");

#if HAVE_VPRINTF
	vfprintf(stderr, fmt, ap);
#else
#	error "No vprintf() available"
#endif

	fprintf(stderr, "\r\n\r\n");
	fprintf(stderr, "USAGE:   %s [-b <bannerfile>] [-c <channel>] [-l] [-L <logfile>]\r\n", prog_name);
	fprintf(stderr, "         %*s [-p <port>] [-s <host>] [-S]\r\n\r\n", (int)strlen(prog_name), " ");

	fprintf(stderr, "OPTIONS: -b <bannerfile>  Show file <bannerfile> to users at startup\r\n");
	fprintf(stderr, "         -c <channel>     Enter the given conference channel at signon\r\n");
	fprintf(stderr, "         -l               Enable logging\r\n");
	fprintf(stderr, "         -L <logfile>     Specify alternate logfile name (default=vchatd-log)\r\n");
	fprintf(stderr, "         -p <port>        Use TCP port <port> (default=1168)\r\n");
	fprintf(stderr, "         -s <host>        Connect to VChat conference server at <host>\r\n");
	fprintf(stderr, "         -S               Log via LOG_LOCAL2 to syslog (implies -l)\r\n");
	fprintf(stderr, "\r\n");

	va_end(ap);
}


syntax highlighted by Code2HTML, v. 0.9.1