diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-10-24 11:07:20 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-10-24 11:07:20 +0000 |
| commit | e8efe81abf77859536b4a1075dd7be5a719658ba (patch) | |
| tree | 2ca9beca97e0b3f2a64ae8abbc17543c41cd04c5 /miscutils | |
| parent | 2d5bd807c0f2a265d438d28f1cfd9d8d2ee627b1 (diff) | |
| download | busybox-w32-e8efe81abf77859536b4a1075dd7be5a719658ba.tar.gz busybox-w32-e8efe81abf77859536b4a1075dd7be5a719658ba.tar.bz2 busybox-w32-e8efe81abf77859536b4a1075dd7be5a719658ba.zip | |
less: add less v.418 help text doc. No code changes.
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/less.c | 211 |
1 files changed, 209 insertions, 2 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index c66788007..1af9685bf 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
| @@ -1488,7 +1488,7 @@ static void keypress_process(int keypress) | |||
| 1488 | colon_process(); | 1488 | colon_process(); |
| 1489 | break; | 1489 | break; |
| 1490 | #if ENABLE_FEATURE_LESS_REWRAP | 1490 | #if ENABLE_FEATURE_LESS_REWRAP |
| 1491 | case '*': | 1491 | case '*': /* Should be -N command / option */ |
| 1492 | option_mask32 ^= FLAG_N; | 1492 | option_mask32 ^= FLAG_N; |
| 1493 | get_terminal_width_height(kbd_fd, &width, &max_displayed_line); | 1493 | get_terminal_width_height(kbd_fd, &width, &max_displayed_line); |
| 1494 | if (width < 20) /* 20: two tabstops + 4 */ | 1494 | if (width < 20) /* 20: two tabstops + 4 */ |
| @@ -1501,7 +1501,7 @@ static void keypress_process(int keypress) | |||
| 1501 | re_wrap(); | 1501 | re_wrap(); |
| 1502 | buffer_fill_and_print(); | 1502 | buffer_fill_and_print(); |
| 1503 | break; | 1503 | break; |
| 1504 | case '&': | 1504 | case '&': /* Should be -S command / option */ |
| 1505 | option_mask32 ^= LESS_STATE_NO_WRAP; | 1505 | option_mask32 ^= LESS_STATE_NO_WRAP; |
| 1506 | buffer_fill_and_print(); | 1506 | buffer_fill_and_print(); |
| 1507 | break; | 1507 | break; |
| @@ -1578,3 +1578,210 @@ int less_main(int argc, char **argv) | |||
| 1578 | keypress_process(keypress); | 1578 | keypress_process(keypress); |
| 1579 | } | 1579 | } |
| 1580 | } | 1580 | } |
| 1581 | |||
| 1582 | /* | ||
| 1583 | Help text of less version 418 is below. | ||
| 1584 | If you are implementing something, keeping | ||
| 1585 | key and/or command line switch compatibility is a good idea: | ||
| 1586 | |||
| 1587 | |||
| 1588 | SUMMARY OF LESS COMMANDS | ||
| 1589 | |||
| 1590 | Commands marked with * may be preceded by a number, N. | ||
| 1591 | Notes in parentheses indicate the behavior if N is given. | ||
| 1592 | h H Display this help. | ||
| 1593 | q :q Q :Q ZZ Exit. | ||
| 1594 | --------------------------------------------------------------------------- | ||
| 1595 | MOVING | ||
| 1596 | e ^E j ^N CR * Forward one line (or N lines). | ||
| 1597 | y ^Y k ^K ^P * Backward one line (or N lines). | ||
| 1598 | f ^F ^V SPACE * Forward one window (or N lines). | ||
| 1599 | b ^B ESC-v * Backward one window (or N lines). | ||
| 1600 | z * Forward one window (and set window to N). | ||
| 1601 | w * Backward one window (and set window to N). | ||
| 1602 | ESC-SPACE * Forward one window, but don't stop at end-of-file. | ||
| 1603 | d ^D * Forward one half-window (and set half-window to N). | ||
| 1604 | u ^U * Backward one half-window (and set half-window to N). | ||
| 1605 | ESC-) RightArrow * Left one half screen width (or N positions). | ||
| 1606 | ESC-( LeftArrow * Right one half screen width (or N positions). | ||
| 1607 | F Forward forever; like "tail -f". | ||
| 1608 | r ^R ^L Repaint screen. | ||
| 1609 | R Repaint screen, discarding buffered input. | ||
| 1610 | --------------------------------------------------- | ||
| 1611 | Default "window" is the screen height. | ||
| 1612 | Default "half-window" is half of the screen height. | ||
| 1613 | --------------------------------------------------------------------------- | ||
| 1614 | SEARCHING | ||
| 1615 | /pattern * Search forward for (N-th) matching line. | ||
| 1616 | ?pattern * Search backward for (N-th) matching line. | ||
| 1617 | n * Repeat previous search (for N-th occurrence). | ||
| 1618 | N * Repeat previous search in reverse direction. | ||
| 1619 | ESC-n * Repeat previous search, spanning files. | ||
| 1620 | ESC-N * Repeat previous search, reverse dir. & spanning files. | ||
| 1621 | ESC-u Undo (toggle) search highlighting. | ||
| 1622 | --------------------------------------------------- | ||
| 1623 | Search patterns may be modified by one or more of: | ||
| 1624 | ^N or ! Search for NON-matching lines. | ||
| 1625 | ^E or * Search multiple files (pass thru END OF FILE). | ||
| 1626 | ^F or @ Start search at FIRST file (for /) or last file (for ?). | ||
| 1627 | ^K Highlight matches, but don't move (KEEP position). | ||
| 1628 | ^R Don't use REGULAR EXPRESSIONS. | ||
| 1629 | --------------------------------------------------------------------------- | ||
| 1630 | JUMPING | ||
| 1631 | g < ESC-< * Go to first line in file (or line N). | ||
| 1632 | G > ESC-> * Go to last line in file (or line N). | ||
| 1633 | p % * Go to beginning of file (or N percent into file). | ||
| 1634 | t * Go to the (N-th) next tag. | ||
| 1635 | T * Go to the (N-th) previous tag. | ||
| 1636 | { ( [ * Find close bracket } ) ]. | ||
| 1637 | } ) ] * Find open bracket { ( [. | ||
| 1638 | ESC-^F <c1> <c2> * Find close bracket <c2>. | ||
| 1639 | ESC-^B <c1> <c2> * Find open bracket <c1> | ||
| 1640 | --------------------------------------------------- | ||
| 1641 | Each "find close bracket" command goes forward to the close bracket | ||
| 1642 | matching the (N-th) open bracket in the top line. | ||
| 1643 | Each "find open bracket" command goes backward to the open bracket | ||
| 1644 | matching the (N-th) close bracket in the bottom line. | ||
| 1645 | m<letter> Mark the current position with <letter>. | ||
| 1646 | '<letter> Go to a previously marked position. | ||
| 1647 | '' Go to the previous position. | ||
| 1648 | ^X^X Same as '. | ||
| 1649 | --------------------------------------------------- | ||
| 1650 | A mark is any upper-case or lower-case letter. | ||
| 1651 | Certain marks are predefined: | ||
| 1652 | ^ means beginning of the file | ||
| 1653 | $ means end of the file | ||
| 1654 | --------------------------------------------------------------------------- | ||
| 1655 | CHANGING FILES | ||
| 1656 | :e [file] Examine a new file. | ||
| 1657 | ^X^V Same as :e. | ||
| 1658 | :n * Examine the (N-th) next file from the command line. | ||
| 1659 | :p * Examine the (N-th) previous file from the command line. | ||
| 1660 | :x * Examine the first (or N-th) file from the command line. | ||
| 1661 | :d Delete the current file from the command line list. | ||
| 1662 | = ^G :f Print current file name. | ||
| 1663 | --------------------------------------------------------------------------- | ||
| 1664 | MISCELLANEOUS COMMANDS | ||
| 1665 | -<flag> Toggle a command line option [see OPTIONS below]. | ||
| 1666 | --<name> Toggle a command line option, by name. | ||
| 1667 | _<flag> Display the setting of a command line option. | ||
| 1668 | __<name> Display the setting of an option, by name. | ||
| 1669 | +cmd Execute the less cmd each time a new file is examined. | ||
| 1670 | !command Execute the shell command with $SHELL. | ||
| 1671 | |Xcommand Pipe file between current pos & mark X to shell command. | ||
| 1672 | v Edit the current file with $VISUAL or $EDITOR. | ||
| 1673 | V Print version number of "less". | ||
| 1674 | --------------------------------------------------------------------------- | ||
| 1675 | OPTIONS | ||
| 1676 | Most options may be changed either on the command line, | ||
| 1677 | or from within less by using the - or -- command. | ||
| 1678 | Options may be given in one of two forms: either a single | ||
| 1679 | character preceded by a -, or a name preceeded by --. | ||
| 1680 | -? ........ --help | ||
| 1681 | Display help (from command line). | ||
| 1682 | -a ........ --search-skip-screen | ||
| 1683 | Forward search skips current screen. | ||
| 1684 | -b [N] .... --buffers=[N] | ||
| 1685 | Number of buffers. | ||
| 1686 | -B ........ --auto-buffers | ||
| 1687 | Don't automatically allocate buffers for pipes. | ||
| 1688 | -c ........ --clear-screen | ||
| 1689 | Repaint by clearing rather than scrolling. | ||
| 1690 | -d ........ --dumb | ||
| 1691 | Dumb terminal. | ||
| 1692 | -D [xn.n] . --color=xn.n | ||
| 1693 | Set screen colors. (MS-DOS only) | ||
| 1694 | -e -E .... --quit-at-eof --QUIT-AT-EOF | ||
| 1695 | Quit at end of file. | ||
| 1696 | -f ........ --force | ||
| 1697 | Force open non-regular files. | ||
| 1698 | -F ........ --quit-if-one-screen | ||
| 1699 | Quit if entire file fits on first screen. | ||
| 1700 | -g ........ --hilite-search | ||
| 1701 | Highlight only last match for searches. | ||
| 1702 | -G ........ --HILITE-SEARCH | ||
| 1703 | Don't highlight any matches for searches. | ||
| 1704 | -h [N] .... --max-back-scroll=[N] | ||
| 1705 | Backward scroll limit. | ||
| 1706 | -i ........ --ignore-case | ||
| 1707 | Ignore case in searches that do not contain uppercase. | ||
| 1708 | -I ........ --IGNORE-CASE | ||
| 1709 | Ignore case in all searches. | ||
| 1710 | -j [N] .... --jump-target=[N] | ||
| 1711 | Screen position of target lines. | ||
| 1712 | -J ........ --status-column | ||
| 1713 | Display a status column at left edge of screen. | ||
| 1714 | -k [file] . --lesskey-file=[file] | ||
| 1715 | Use a lesskey file. | ||
| 1716 | -L ........ --no-lessopen | ||
| 1717 | Ignore the LESSOPEN environment variable. | ||
| 1718 | -m -M .... --long-prompt --LONG-PROMPT | ||
| 1719 | Set prompt style. | ||
| 1720 | -n -N .... --line-numbers --LINE-NUMBERS | ||
| 1721 | Don't use line numbers. | ||
| 1722 | -o [file] . --log-file=[file] | ||
| 1723 | Copy to log file (standard input only). | ||
| 1724 | -O [file] . --LOG-FILE=[file] | ||
| 1725 | Copy to log file (unconditionally overwrite). | ||
| 1726 | -p [pattern] --pattern=[pattern] | ||
| 1727 | Start at pattern (from command line). | ||
| 1728 | -P [prompt] --prompt=[prompt] | ||
| 1729 | Define new prompt. | ||
| 1730 | -q -Q .... --quiet --QUIET --silent --SILENT | ||
| 1731 | Quiet the terminal bell. | ||
| 1732 | -r -R .... --raw-control-chars --RAW-CONTROL-CHARS | ||
| 1733 | Output "raw" control characters. | ||
| 1734 | -s ........ --squeeze-blank-lines | ||
| 1735 | Squeeze multiple blank lines. | ||
| 1736 | -S ........ --chop-long-lines | ||
| 1737 | Chop long lines. | ||
| 1738 | -t [tag] .. --tag=[tag] | ||
| 1739 | Find a tag. | ||
| 1740 | -T [tagsfile] --tag-file=[tagsfile] | ||
| 1741 | Use an alternate tags file. | ||
| 1742 | -u -U .... --underline-special --UNDERLINE-SPECIAL | ||
| 1743 | Change handling of backspaces. | ||
| 1744 | -V ........ --version | ||
| 1745 | Display the version number of "less". | ||
| 1746 | -w ........ --hilite-unread | ||
| 1747 | Highlight first new line after forward-screen. | ||
| 1748 | -W ........ --HILITE-UNREAD | ||
| 1749 | Highlight first new line after any forward movement. | ||
| 1750 | -x [N[,...]] --tabs=[N[,...]] | ||
| 1751 | Set tab stops. | ||
| 1752 | -X ........ --no-init | ||
| 1753 | Don't use termcap init/deinit strings. | ||
| 1754 | --no-keypad | ||
| 1755 | Don't use termcap keypad init/deinit strings. | ||
| 1756 | -y [N] .... --max-forw-scroll=[N] | ||
| 1757 | Forward scroll limit. | ||
| 1758 | -z [N] .... --window=[N] | ||
| 1759 | Set size of window. | ||
| 1760 | -" [c[c]] . --quotes=[c[c]] | ||
| 1761 | Set shell quote characters. | ||
| 1762 | -~ ........ --tilde | ||
| 1763 | Don't display tildes after end of file. | ||
| 1764 | -# [N] .... --shift=[N] | ||
| 1765 | Horizontal scroll amount (0 = one half screen width) | ||
| 1766 | |||
| 1767 | --------------------------------------------------------------------------- | ||
| 1768 | LINE EDITING | ||
| 1769 | These keys can be used to edit text being entered | ||
| 1770 | on the "command line" at the bottom of the screen. | ||
| 1771 | RightArrow ESC-l Move cursor right one character. | ||
| 1772 | LeftArrow ESC-h Move cursor left one character. | ||
| 1773 | CNTL-RightArrow ESC-RightArrow ESC-w Move cursor right one word. | ||
| 1774 | CNTL-LeftArrow ESC-LeftArrow ESC-b Move cursor left one word. | ||
| 1775 | HOME ESC-0 Move cursor to start of line. | ||
| 1776 | END ESC-$ Move cursor to end of line. | ||
| 1777 | BACKSPACE Delete char to left of cursor. | ||
| 1778 | DELETE ESC-x Delete char under cursor. | ||
| 1779 | CNTL-BACKSPACE ESC-BACKSPACE Delete word to left of cursor. | ||
| 1780 | CNTL-DELETE ESC-DELETE ESC-X Delete word under cursor. | ||
| 1781 | CNTL-U ESC (MS-DOS only) Delete entire line. | ||
| 1782 | UpArrow ESC-k Retrieve previous command line. | ||
| 1783 | DownArrow ESC-j Retrieve next command line. | ||
| 1784 | TAB Complete filename & cycle. | ||
| 1785 | SHIFT-TAB ESC-TAB Complete filename & reverse cycle. | ||
| 1786 | CNTL-L Complete filename, list all. | ||
| 1787 | */ | ||
