Added an option to invert the orders of lines.
[selector.git] / selector.1
1 .TH "SELECTOR" "1"
2 .SH "NAME"
3 selector - A simple shell command for dynamic pattern selection
4 .SH "SYNOPSIS"
5 .PP
6 \fBselector\fP [\fBoptions\fP] -f <filename>
7 .SH "DESCRIPTION"
8 .PP
9 \fBselector\fP is a command line dynamic string selection. A you type
10 a list of strings separated by ';', the display is updated in real
11 time to show only the lines containing all the said strings.
12
13 The main usage of selector is as an efficient search in the shell
14 command history. With the correct option, it will inject the selected
15 line into the virtual tty input buffer, hence allowing the user to
16 edit the line and execute it as a standard command.
17
18 Keys corresponding to ASCII codes between ' ' and '~' add a character
19 to the pattern string. The Delete key, Backspace key, ^D and ^H delete
20 one character from the pattern string.
21
22 The Up and Down cursor keys move the selected line accordingly, and
23 PageUp and PageDown move by ten lines. The Home and End key move to
24 the top and the bottom of the list respectively. The return key
25 selects the current line and exits.
26
27 You can cancel the selection either by interrupting the command with
28 ^C or by typing ^G.
29
30 .SH "OPTIONS"
31 .IP "\fB-h\fP" 10
32 display help and exits
33 .IP "\fB-v\fP" 10
34 inject the selected line into the tty input buffer
35 .IP "\fB-m\fP" 10
36 force the monochrome mode
37 .IP "\fB-i\fP" 10
38 inverse the order of lines so that the recent lines are at the top
39 .IP "\fB-z\fP" 10
40 remove the time prefix from zsh history
41 .IP "\fB-c <fg modeline> <bg modeline> <fg highlight> <bg highlight>\fP" 10
42 select the display colors for the modeline and the highlighted line
43 .IP "\fB-o <output filename>\fP" 10
44 write the selected line into the specified file
45 .IP "\fB-s <pattern separator>\fP" 10
46 specify the symbol to separate the substrings in the search pattern
47 .IP "\fB-l <max number of lines>\fP" 10
48 specify the maximum number of lines to consider
49 .IP "\fB-f <input filename>\fP" 10
50 specify the file to search into
51
52 .SH "EXAMPLES"
53
54 To use selector to search into your shell history:
55
56 .B selector \-f ${HISTFILE} \-v
57
58 .SH "BUGS"
59
60 Probably many. The main problem is the usage of Linux-specific ioctl()
61 to put the selected line in the tty buffer.
62
63 .SH "AUTHOR"
64 .PP
65 Written by Francois Fleuret <francois@fleuret.org>. Permission is
66 granted to copy, distribute and/or modify this document under the
67 terms of the GNU GPL.