Exemplo n.º 1
0
Arquivo: gram.c Projeto: joequant/iraf
/* LISTALLHELP -- Starting at curpack, list out all packages and their tasks
 * in a circular fashion until get back to curpack. this is like the search
 * path works.  Label the current package in some way.  Serves ?? directive.
 * TODO: this should be optimized once a nice form is settled on.
 */
void 
listallhelp (int show_invis)
{
	register struct package *pkp;

	pkp = curpack;
	do {
		oprintf ("    %s:\n", pkp->pk_name);
		listhelp (pkp, show_invis);
		if ((pkp = pkp->pk_npk) == NULL)
			pkp = reference (package, pachead);
	} until (pkp == curpack);
}
Exemplo n.º 2
0
/* PPROMPT -- Print prompt as first two chars of prompt string plus "> ", i.e.,
 * "pk> ".  If null prompt string (NOCLOSURE), print the continuation prompt
 * ">>> ".  Also print, before the prompt, all ltasks in current package
 * if menus() are enabled and a new package has been invoked.
 */
void
pprompt (
  register char *string
)
{
	static	struct package *lastpack = NULL;

	if (menus() && curpack != lastpack) {
	    listhelp (curpack, NO);
	    lastpack = curpack;
	}

	printf ("%2.2s", string);
	printf ("> ");
	fflush (stdout);
}
Exemplo n.º 3
0
void dohelp(bc *bc, char *p)
{
help *h;

	if(!*p)
		listhelp(bc, p);
	else
	{
		h=findhelp(p);
		if(h && h->name)
			tprintf(bc, "\n%s:\n\n%s\n", p, h->info);
		else
			tprintf(bc, "No help available on '%s'\n", p);
	}

}
Exemplo n.º 4
0
/* GET_PROMPT -- Get prompt as first two chars of prompt string plus "> ", i.e.,
 * "pk> ".  If null prompt string (NOCLOSURE), print the continuation prompt
 * ">>> ".  Also print, before the prompt, all ltasks in current package
 * if menus() are enabled and a new package has been invoked.
 */
void 
get_prompt (register char *string)
{
	static	struct package *lastpack = NULL;
	extern	long int run_level;

        if (menus() && curpack != lastpack) {
            listhelp (curpack, NO);
            lastpack = curpack;
	    printf ("\n");
	    fflush (stdout);
        }

	if (strncmp ("clpackage", string, 9) == 0)
	    strcpy (prompt, "ecl> ");
	else
	    sprintf (prompt,
		(eh_longprompt == YES) ? "%s> " : "%2.2s> ", string);

	run_level = 0;
}