Module: Help

Defined in:
lib/cless/help.rb

Constant Summary collapse

CONTENT =
"          CLESS HELP\n        Press q to quit\n\n Key binding\n ===========\n\n Key binding is mostly compatible with the original less.\n\n ARROW_DOWN, ENTER, ^N, ^E, j     scroll down one line\n SPACE BAR, PAGE_DOWN, ^V, ^F, f  scroll down one page\n ARROW_UP, ^Y, ^P, ^K, y, k       scroll up one line\n PAGE_UP, ^B, b                   scroll up one page\n ARROW_RIGHT, ESC-)               scroll right one column\n ARROW_LEFT, ESC-(                scroll left one column\n d                                scroll down half screen\n u                                scroll up half screen\n HOME, g, <                       go to top of file\n END, G, >                        go to end of file\n +                                increase column spacing\n -                                decrease column spacing\n c                                show/hide the column numbers\n l                                show/hide the line numbers (1 based)\n L                                show byte offset instead of line number\n h                                hide column (space separated list)\n H                                show column (space separated list)\n ` (back-tick)                    change first column index\n o                                toggle highlighting of alternate lines\n O                                toggle highlighting of alternate columns \n m                                shift line highlighting start\n M                                shift column highlighting start\n F                                go to. 10  -> absolute line number\n                                         10o -> absolute offset\n                                         10% -> percentage in file\n p                                go to percentage.\n v                                format columns.\n i                                ignore lines. Lines or regexp\n I                                remove ignore lines patterns\n /                                forward search\n ?                                backward search\n n                                repeat previous search\n N                                repeat previous search, reversed direction\n s                                save content to file\n E                                export content to some format (tex, csv)\n S                                change split regexp\n t                                toggle column names\n ^                                use a line from file for column headers\n |                                change column separator character\n [                                shift content of a column to the left\n ]                                shift content of a column to the right\n {                                shift content of a column to the start\n }                                shift content of a column to the end\n (                                reduce width of a column\n )                                increase width of a column\n \\\\                               change column padding string\n r, R, ^R, ^L                     refresh display\n :                                command menu\n q                                quit\n\n Notes on Searching\n ==================\n\n The search patterns are Perl compatible regular expressions. It is ill\n advised to use patterns that match white spaces as the spaces are\n ignored when displayed. I.e., a match MUST be contained within a\n column to be properly displayed. If a match span accross columns,\n strange behavior may occure.  To force a match to be the entire column\n width, use the word boundary anchor: \\\\b. E.g., to match the line with\n a column having only 0 (instead of any column which contains a 0), use\n the following pattern: \\\\b0\\\\b.\n \n Note also that the match might be in a hidden column. In any case, if\n the line numbers are displayed, a line having a match will have its\n line number in reverse video.\n\n Environment variable\n ====================\n\n If set, the environment variable CLESS gives switches to be added to the\n switches found on the command line. For example, to always display the line\n numbers and columns:\n    CLESS=\"--lines --column\"\n"
OPTIONS =
"--no-column --no-line --no-offset --no-line-highlight " +
"--no-column-highlight --no-column-names --no-parse-header " +
"--ignore '/^\s/'"

Class Method Summary collapse

Class Method Details

.displayObject



91
92
93
94
95
96
# File 'lib/cless/help.rb', line 91

def self.display
  io = open("|#{$0} #{OPTIONS}", "w")
  io.write(CONTENT)
  io.close
  Process.wait rescue nil
end