/******************************************************************************
* This file is Copyright 1993 by Philip G. Richards.  All Rights Reserved.
* See the file README that came with this distribution for permissions on
* code usage, copying, and distribution.  It comes with absolutely no warranty.
* email: <pgr@prg.ox.ac.uk>
******************************************************************************/

/* ---INFOBEGIN--- *  DO NOT DELETE THIS COMMENT BLOCK!!!
COMMAND readme none "read the README; set readme mode to never, once, or always"
 *  ---INFOEND---  */

extern int readme_max;

#include "client.h"
#include "main.h"
#include "table.h"

int
lreadme_main(int argc, char *const*argv, char **envp)
{
    if (argc < 2)
    {
	if (!notconnected)
	    util_print_readme();
	else
	{
	    ffprintf(STDERR, "?not connected\n");
	    return 1;
	}
    }
    else
    {
	if (strcmp(argv[1], "never") == 0 || strcmp(argv[1], "0") == 0)
	    readme_max = 0;
	else if (strcmp(argv[1], "once") == 0 || strcmp(argv[1], "1") == 0)
	    readme_max = 1;
	else if (strcmp(argv[1], "always") == 0 || strcmp(argv[1], "2") == 0)
	    readme_max = -1;
	else
	{
	    ffprintf(STDERR, "?usage: readme [never|once|always]|[0-2]\n");
	    return 1;
	}
    }

    return 0;
}


syntax highlighted by Code2HTML, v. 0.9.1