#define NO_TNOSFOPEN
#include <errno.h>
#define VERSION_FILE_BUILD 1
int doversion (int argc, char *argv[], void *p);
#include "version.c"

#if !defined(_lint)
static char _rcsid[] OPTIONAL = "$Id: mkvers.c,v 1.24 2000/05/09 14:18:54 brian Exp $";
#endif

int
main (int argc, char *argv[])
{
char file[256];

    if (argc < 2)	{
	printf ("mkvers: syntax error - no TNOS root directory given\n");
	return (0);
    }
    puts ("--- Creating new TNOS "VERSION" VersionFile\n");
    (void) fflush (stdout);

    sprintf (file, "%s/etc/help/version.hlp", argv[1]);
    if (freopen (file, "w", stdout) == NULL)	{
	fprintf (stderr, "mkvers: can't open version file '%s'\n", file);
	return (errno);
    }
    (void) doversion (0, (char **) 0, (void *) 0);
    return 0;
}
