/******************************************************************************
* 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 prompt none "turn prompting on or off"
 *  ---INFOEND---  */

#include "client.h"
#include "table.h"
#include <stdlib.h>

int askprompt = 1;

int
lprompt_main(int argc, char *const*argv, char **envp)
{
    if (argc < 2)
	askprompt = !askprompt;
    else
    {
	if (strcmp(argv[1], "off") == 0)
	    askprompt = 0;
	else if (strcmp(argv[1], "on") == 0)
	    askprompt = 1;
	else if (strcmp(argv[1], "?") != 0)
	    askprompt = (atoi(argv[1]) != 0);
    }

    ffprintf(STDINFO, "prompting is %s.\n", askprompt? "on": "off");

    return 0;
}


syntax highlighted by Code2HTML, v. 0.9.1