Annotation of 43BSD/contrib/mh/miscellany/less/help.c, revision 1.1.1.1

1.1       root        1: #include  "less.h"
                      2: 
                      3: /*
                      4:  * Display some help.
                      5:  * Help is in two pages.
                      6:  */
                      7:        static void
                      8: help0()
                      9: {
                     10:        puts("f, SPACE       Forward one screen.\n");
                     11:        puts("b              Backward one screen.\n");
                     12:        puts("e, j, CR    *  Forward N lines, default 1.\n");
                     13:        puts("y, k        *  Backward N lines, default 1.\n");
                     14:        puts("d           *  Forward N lines, default 10 or last N to d or u command.\n");
                     15:        puts("u           *  Backward N lines, default 10 or last N to d or u command.\n");
                     16:        puts("r              Repaint screen.\n");
                     17:        puts("g           *  Go to line N, default 1.\n");
                     18:        puts("G           *  Like g, but default is last line in file.\n");
                     19:        puts("=              Print current file name\n");
                     20:        puts("/pattern    *  Search forward for N-th occurence of pattern.\n");
                     21:        puts("?pattern    *  Search backward for N-th occurence of pattern.\n");
                     22:        puts("n           *  Repeat previous search (for N-th occurence).\n");
                     23:        puts("q              Exit.\n");
                     24:        error("More help...");
                     25: }
                     26: 
                     27:        static void
                     28: help1()
                     29: {
                     30:        char message[100];
                     31:        extern char all_options[];
                     32: 
                     33:        puts("R              Repaint screen, discarding buffered input.\n");
                     34:        puts("p, %        *  Position to N percent into the file.\n");
                     35:        puts("m<letter>      Mark the current position with <letter>.\n");
                     36:        puts("'<letter>      Return to a previously marked position.\n");
                     37:        sprintf(message, 
                     38:             "-X             Toggle a flag (X may be one of \"%s\").\n", 
                     39:                                all_options);
                     40:        puts(message);
                     41:        puts("E [file]       Examine a new file.\n");
                     42:        puts("N              Examine the next file (from the command line).\n");
                     43:        puts("P              Examine the previous file (from the command line).\n");
                     44:        puts("V              Print version number.\n");
                     45: #if SHELL_ESCAPE
                     46:        puts("!command       Passes the command to a shell to be executed.\n");
                     47: #endif
                     48: #if EDITOR
                     49:        sprintf(message,
                     50:             "v              Edit the current file with $EDITOR (default %s).\n",
                     51:                                EDIT_PGM);
                     52:        puts(message);
                     53: #endif
                     54:        error("");
                     55: }
                     56: 
                     57:        public void
                     58: help()
                     59: {
                     60:        register int i;
                     61: 
                     62:        for (i = 0;  i < 2;  i++)
                     63:        {
                     64:                clear();
                     65:                puts("Commands marked with * may be preceeded by a number, N.\n\n");
                     66: 
                     67:                switch (i)
                     68:                {
                     69:                case 0:         help0();        break;
                     70:                case 1:         help1();        break;
                     71:                }
                     72:        }
                     73: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.