#include "less.h" extern char editor[]; /* * Display some help. * Help is in two pages. */ static void help0() { bo_enter(); ttputs("& Also print the current file. (NEW)\n"); bo_exit(); ttputs("f, SPACE Forward one screen.\n"); ttputs("b,B Backward one screen.\n"); ttputs("e, j, CR * Forward N lines, default 1.\n"); ttputs("y, k * Backward N lines, default 1.\n"); ttputs("d * Forward N lines, default 10 or last N to d or u command.\n"); ttputs("u * Backward N lines, default 10 or last N to d or u command.\n"); ttputs("r Repaint screen.\n"); ttputs("g * Go to line N, default 1.\n"); ttputs("G * Like g, but default is last line in file.\n"); ttputs("= Print current file name\n"); ttputs("/pattern * Search forward for N-th occurence of pattern.\n"); ttputs("?pattern * Search backward for N-th occurence of pattern.\n"); ttputs("n * Repeat previous search (for N-th occurence).\n"); ttputs("q,Q Exit.\n"); error("More help..."); } static void help1() { char message[100]; extern char all_options[]; ttputs("R Repaint screen, discarding buffered input.\n"); ttputs("p, % * Position to N percent into the file.\n"); ttputs("m Mark the current position with .\n"); ttputs("' Return to a previously marked position.\n"); bo_enter(); ttputs("'' Return to previous position. (NEW)\n"); ttputs("-z set the number of lines scrolled. (NEW)\n"); bo_exit(); sprintf(message, "-X Toggle a flag (one of \"%s\").\n", all_options); ttputs(message); ttputs("E [file] Examine a new file.\n"); ttputs("N Examine the next file (from the command line).\n"); ttputs("P Examine the previous file (from the command line).\n"); ttputs("V Print version number.\n"); #if SHELL_ESCAPE ttputs("!command Passes the command to a CLI to be executed.\n"); #endif #if EDITOR sprintf(message, "v Edit the current file (default editor:%s).\n", editor); ttputs(message); #endif error(""); } public void help() { register int i; for (i = 0; i < 2; i++) { clear(); so_enter(); ttputs("Amiga LESS 1.3 by\n"); ttputs("Bob Leivian \n"); ttputs("2702 W. Curry St."); so_exit(); ttputs(" "); so_enter(); ttputs("comments and contributions welcome\n"); ttputs("Chandler AZ 85224"); so_exit(); ttputs("\n\nCommands marked with * may be preceeded by a number, N.\n\n"); switch (i) { case 0: help0(); break; case 1: help1(); break; } } }