head 1.7; access; symbols ISELECT_1_4_0:1.7 ISELECT_1_3_1:1.6 ISELECT_1_3_0:1.5 ISELECT_1_2_0:1.1.1.4 ISELECT_1_1_0:1.1.1.3 ISELECT_1_0_4:1.1.1.2 ISELECT_1_0_0:1.1.1.1 vendor:1.1.1; locks; strict; comment @.\" @; 1.7 date 2007.07.08.09.31.20; author rse; state Exp; branches; next 1.6; commitid 35HJBbPX5gshJWos; 1.6 date 2005.10.05.18.37.19; author rse; state Exp; branches; next 1.5; 1.5 date 2004.09.11.15.24.05; author rse; state Exp; branches; next 1.4; 1.4 date 2004.09.11.15.19.59; author rse; state Exp; branches; next 1.3; 1.3 date 2004.09.11.15.18.49; author rse; state Exp; branches; next 1.2; 1.2 date 2000.07.25.11.53.24; author rse; state Exp; branches; next 1.1; 1.1 date 97.09.17.07.45.33; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 97.09.17.07.45.33; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 98.01.03.09.09.34; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 98.04.05.16.39.01; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 99.03.31.06.50.38; author rse; state Exp; branches; next ; desc @@ 1.7 log @bump version @ text @.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "ISELECT 1" .TH ISELECT 1 "2007-07-08" "EN" "Ralf S. Engelschall" .SH "NAME" iSelect \-\- Interactive Selection Tool .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBiselect\fR [\fB\-d\fR \fI\s-1STR\s0\fR,\fI\s-1STR\s0\fR] [\fB\-c\fR] [\fB\-f\fR] [\fB\-a\fR] [\fB\-e\fR] [\fB\-p\fR \fI\s-1NUM\s0\fR] [\fB\-k\fR \fI\s-1KEY\s0\fR[:\fI\s-1OKEY\s0\fR]] [\fB\-m\fR] [\fB\-n\fR \fI\s-1STR\s0\fR] [\fB\-t\fR \fI\s-1STR\s0\fR] [\fB\-S\fR] [\fB\-K\fR] [\fB\-P\fR] [\fB\-Q\fR \fI\s-1STR\s0\fR] [\fIline1\fR \fIline2\fR ...] .PP \&\fBiselect\fR [\fB\-V\fR] .SH "VERSION" .IX Header "VERSION" 1.4.0 (08\-Jul\-2007) .SH "DESCRIPTION" .IX Header "DESCRIPTION" .Sh "Intend" .IX Subsection "Intend" iSelect is an interactive line selection tool for \s-1ASCII\s0 files, operating via a full-screen Curses-based terminal session. It can be used either as an user interface frontend controlled by a Bourne\-Shell, Perl or other type of script backend as its wrapper or in batch as a pipe filter (usually between \fIgrep\fR and the final executing command). In other words: iSelect was designed to be used for any types of interactice line-based selections. .Sh "Input Data" .IX Subsection "Input Data" Input is read either from the command line (\fIline1\fR \fIline2\fR ...) where each argument corresponds to one buffer line or from \fIstdin\fR (when no arguments are given) where the buffer lines are determined according to the newline characters. .PP You can additionally let substrings displayed in Bold mode for non-selectable lines (because the selectable lines are always displayed bold) by using the construct ``\f(CW\*(C`\*(C'\fR...\f(CW\*(C`\*(C'\fR'' as in \s-1HTML\s0. .Sh "Selections" .IX Subsection "Selections" The selection is either just a single line (default) or multiple lines (option \&\fB\-m\fR). Per default no lines are selectable. If a line contains the string ``\f(CW\*(C`\*(C'\fR'' (or a string with different delimiters configured via option \fB\-d\fR) at any position this string is stripped and the line is selectable. Its result (printed to \fIstdout\fR) is the line contents itself (but without the ``\f(CW\*(C`\*(C'\fR'' string of course). If option \fB\-a\fR is used all lines are selectable and their result is again the line itself, i.e. using option \fB\-a\fR is the same as adding ``\f(CW\*(C`\*(C'\fR'' to every line of the input data. When you want a specific result (i.e. not just the line contents itself), you have to use the special variant ``\f(CW\*(C`\*(C'\fR'' which results in the output ``\f(CW\*(C`result text\*(C'\fR'' when the corresponding line is selected. .PP When you use a specific result via ``\f(CW\*(C`\*(C'\fR'' the \fIresult text\fR can contain ``\f(CW\*(C`%[query text]s\*(C'\fR'' and ``\f(CW\*(C`%[query text]S\*(C'\fR'' constructs. For every such construct an interactive query is done and the result replaces the construct. The ``\f(CW\*(C`%[query text]S\*(C'\fR'' construct is like ``\f(CW\*(C`%[query text]s\*(C'\fR'' except that the empty string as the query result is not accepted on input. .PP The Curses-based full-screen selection is always done via \fI/dev/tty\fR, because the \fIstdin\fR and \fIstdout\fR filehandles are usually tied to the input and output data streams. .Sh "Output Data" .IX Subsection "Output Data" The output is the line itself or the string given with ``\f(CW\*(C`\*(C'\fR''. When multiple line selection mode (option \fB\-m\fR) is used the output is all selected lines theirself or their configured result strings. Output always is written to \fIstdout\fR. .SH "OPTIONS" .IX Header "OPTIONS" .Sh "Input Options" .IX Subsection "Input Options" These options control how \fIiSelect\fR parses its input. .IP "\fB\-d\fR \fI\s-1STR\s0\fR, \fB\-\-delimiter=\fR\fI\s-1STR\s0\fR" 4 .IX Item "-d STR, --delimiter=STR" Sets the delimiters for the selection tags. The default is `\f(CW\*(C`<,>\*(C'\fR', i.e. the selection tags have to read ``\f(CW\*(C`\*(C'\fR'' and ``\f(CW\*(C`\*(C'\fR'' .IP "\fB\-c\fR, \fB\-\-strip\-comments\fR" 4 .IX Item "-c, --strip-comments" Strips all sharp comment lines from the input buffer before parsing. .IP "\fB\-f\fR, \fB\-\-force\-browse\fR" 4 .IX Item "-f, --force-browse" Browse always, i.e. even when the input buffer contains no or only one line. .IP "\fB\-a\fR, \fB\-\-all\-select\fR" 4 .IX Item "-a, --all-select" Force all lines to be selectable. .IP "\fB\-e\fR, \fB\-\-exit\-no\-select\fR" 4 .IX Item "-e, --exit-no-select" Exit immediately if no lines are selectable. In this case not even the Curses screen is initialized. .Sh "Display Options" .IX Subsection "Display Options" .IP "\fB\-p\fR \fI\s-1NUM\s0\fR, \fB\-\-position=\fR\fI\s-1NUM\s0\fR" 4 .IX Item "-p NUM, --position=NUM" Sets the cursor position to line \fI\s-1NUM\s0\fR. .IP "\fB\-k\fR \fI\s-1KEY\s0\fR[:\fI\s-1OKEY\s0\fR], \fB\-\-key=\fR\fIKEY[:\fI\s-1OKEY\s0\fI]\fR" 4 .IX Item "-k KEY[:OKEY], --key=KEY[:OKEY]" Defines an additional input key. Per default \fI\s-1OKEY\s0\fR is \f(CW\*(C`RETURN\*(C'\fR, i.e. for instance \fB\-kf\fR defines another selection key `\f(CW\*(C`f\*(C'\fR'. .IP "\fB\-m\fR, \fB\-\-multi\-line\fR" 4 .IX Item "-m, --multi-line" Enable multi-line selection where you can select more then one line via \s-1SPACE\s0 key. .IP "\fB\-n\fR \fI\s-1STR\s0\fR, \fB\-\-name=\fR\fI\s-1STR\s0\fR" 4 .IX Item "-n STR, --name=STR" Sets the name string, displayed flush left at the bottom of the browser window. .IP "\fB\-t\fR \fI\s-1STR\s0\fR, \fB\-\-title=\fR\fI\s-1STR\s0\fR" 4 .IX Item "-t STR, --title=STR" Sets the title bar string, displayed centered at the bottom of the browser window. .Sh "Output Options" .IX Subsection "Output Options" .IP "\fB\-S\fR, \fB\-\-strip\-result\fR" 4 .IX Item "-S, --strip-result" Strip all leading and trailing whitespaces from the result string. .IP "\fB\-K\fR, \fB\-\-key\-result\fR" 4 .IX Item "-K, --key-result" Prefix the result string (given on \fIstdout\fR) with the corresponding selection key which was used. This usually is \f(CW\*(C`RETURN\*(C'\fR or \f(CW\*(C`KEY_RIGHT\*(C'\fR but can be any of the additional keys defined by option \fB\-k\fR. When you use \fB\-kf\fR and select a line \f(CW\*(C`Foo Bar\*(C'\fR with key `\f(CW\*(C`f\*(C'\fR' the result string is ``\f(CW\*(C`f:Foo Bar\*(C'\fR''. .IP "\fB\-P\fR, \fB\-\-position\-result\fR" 4 .IX Item "-P, --position-result" Prefix the result string (given on \fIstdout\fR) with the corresponding cursor position followed by a colon. When you selected line \fIN\fR and this line has the result \f(CW\*(C`Foo Bar\*(C'\fR configured the result string is ``\f(CW\*(C`N:Foo Bar\*(C'\fR''. .IP "\fB\-Q\fR \fI\s-1STR\s0\fR, \fB\-\-quit\-result=\fR\fI\s-1STR\s0\fR" 4 .IX Item "-Q STR, --quit-result=STR" Sets the result string on quit. Default is the empty string. .Sh "Giving Feedback" .IX Subsection "Giving Feedback" .IP "\fB\-V\fR, \fB\-\-version\fR" 4 .IX Item "-V, --version" Displays version identification string. .SH "KEYSTROKES" .IX Header "KEYSTROKES" .Sh "Cursor Movement" .IX Subsection "Cursor Movement" Use these to browse through the selection list. .PP .Vb 6 \& CURSOR-UP ..... Move cursor one line up \& CURSOR-DOWN ... Move cursor one line down \& PAGE-UP ....... Move cursor one page up \& PAGE-DOWN ..... Move cursor one page down \& g ............. Goto first line \& G ............. Goto last line .Ve .Sh "Line Selection" .IX Subsection "Line Selection" Use these to select one line and exit in standard mode or one or more lines in multi-line mode. .PP .Vb 3 \& RETURN ........ Select line and exit \& CURSOR-RIGHT .. Select line and exit \& SPACE ......... Select line and stay (multi-line mode only) .Ve .Sh "Others" .IX Subsection "Others" Use these to quit iSelect or to show its help and version page. .PP .Vb 4 \& q ............. Quit (exit without selection) \& CURSOR-LEFT ... Quit (exit without selection) \& h ............. Help Page \& v ............. Version Page .Ve .SH "EXAMPLE" .IX Header "EXAMPLE" As an example we present a real-life situation where iSelect can enhance an existing functionality. We define two Bash functions (for your \&\fI$HOME/.bashrc\fR file) which enhance the built-in `\fIcd\fR' command of the shell. .PP .Vb 7 \& # database scan for enhanced cd command \& cds () { \& (cd $HOME; \& find . -type d -print |\e \& sed -e "s;^\e.;$HOME;" |\e \& sort -u >$HOME/.cdpaths ) & \& } .Ve .PP .Vb 11 \& # definition of the enhanced cd command \& cd () { \& if [ -d $1 ]; then \& builtin cd $1 \& else \& builtin cd `egrep "/$1[^/]*$" $HOME/.cdpaths |\e \& iselect -a -Q $1 -n "chdir" \e \& -t "Change Directory to..."` \& fi \& PS1="\eu@@\eh:$PWD\en:> " \& } .Ve .PP This new `\fIcd\fR' command is compatible with Bashs built-in variant for the case where the specified directory actually exists. When it doesn't, the original `\fIcd\fR' would immediately give an error (assuming we have no \fI\s-1CDPATH\s0\fR variable defined). Here this enhanced version tries harder. First it searches for such a directory in a previously built (via \fIcds\fR) \fI$HOME/.cdpaths\fR files. When no line was found, iSelect just returns the given directory as the default result and `\fIcd\fR' then fails as usual with an error message. When only one directory was found, iSelect directly results this particular line to `\fIcd\fR'. And only when more then one directory was found, iSelect opens its Curses-based selection screen and lets the user choose interactively between those directories. The chosen directory is then finally given to `\fIcd\fR'. .PP For more useful examples on how to use iSelect, see the \fIcontrib/\fR directory of the iSelect distribution tarball. .SH "AUTHOR" .IX Header "AUTHOR" .Vb 3 \& Ralf S. Engelschall \& rse@@engelschall.com \& www.engelschall.com .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 1 \& iSelect Home: http://www.ossp.org/pkg/tool/iselect/ .Ve @ 1.6 log @bump version before release @ text @d1 1 a1 1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 d132 1 a132 1 .TH ISELECT 1 "2005-10-05" "EN" "Ralf S. Engelschall" d158 1 a158 1 1.3.1 (05\-Oct\-2005) @ 1.5 log @more cosmetics @ text @d1 1 a1 1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 d132 1 a132 1 .TH ISELECT 1 "2004-09-11" "EN" "Ralf S. Engelschall" d158 1 a158 1 1.3.0 (11\-Sep\-2004) @ 1.4 log @regenerated @ text @d369 1 a369 1 \& iSelect Home: http://www.engelschall.com/sw/iselect/ @ 1.3 log @modernize source tree @ text @d158 1 a158 1 1.2.1 (25\-Jul\-2000) @ 1.2 log @Merge in pending changes @ text @d1 5 a5 6 .rn '' }` ''' $RCSfile$$Revision$$Date$ ''' ''' $Log$ ''' .de Sh d13 1 a13 1 .de Sp d17 1 a17 7 .de Ip .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .de Vb d22 1 a22 1 .de Ve a23 1 d26 6 a31 6 ''' ''' ''' Set up \*(-- to give an unbreakable dash; ''' string Tr holds user defined translation string. ''' Bell System Logo is used as a dummy character. ''' d33 1 d35 8 a42 20 .ds -- \(*W- .ds PI pi .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch .ds L" "" .ds R" "" ''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of ''' \*(L" and \*(R", except that they are used on ".xx" lines, ''' such as .IP and .SH, which do another additional levels of ''' double-quote interpretation .ds M" """ .ds S" """ .ds N" """"" .ds T" """"" .ds L' ' .ds R' ' .ds M' ' .ds S' ' .ds N' ' .ds T' ' d45 4 a48 15 .ds -- \(em\| .tr \*(Tr .ds L" `` .ds R" '' .ds M" `` .ds S" '' .ds N" `` .ds T" '' .ds L' ` .ds R' ' .ds M' ` .ds S' ' .ds N' ` .ds T' ' .ds PI \(*p d50 8 a57 12 .\" If the F register is turned on, we'll generate .\" index entries out stderr for the following things: .\" TH Title .\" SH Header .\" Sh Subsection .\" Ip Item .\" X<> Xref (embedded .\" Of course, you have to process the output yourself .\" in some meaninful fashion. .if \nF \{ .de IX .tm Index:\\$1\t\\n%\t"\\$2" d59 2 a60 2 .nr % 0 .rr F d62 4 a65 3 .TH ISELECT 1 "EN" "22/Jun/1999" "Ralf S. Engelschall" .UC .if n .hy 0 d67 4 a70 14 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .de CQ \" put $1 in typewriter font .ft CW 'if n "\c 'if t \\&\\$1\c 'if n \\&\\$1\c 'if n \&" \\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 '.ft R .. .\" @@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 . \" AM - accent mark definitions .bd B 3 . \" fudge factors for nroff and troff d72 5 a76 5 . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP d79 5 a83 5 . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& d85 1 a85 1 . \" simple accents for nroff and troff d87 6 a92 9 . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds ? ? . ds ! ! . ds / . ds q d95 6 a100 9 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' . ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' . ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' d102 1 a102 1 . \" troff and (daisy-wheel) nroff accents a104 4 .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#] .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u' .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u' .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#] d112 1 a112 3 .ds oe o\h'-(\w'o'u*4/10)'e .ds Oe O\h'-(\w'O'u*4/10)'E . \" corrections for vroff d115 1 a115 1 . \" for low resolution devices (crt and lpr) d118 9 a126 15 . ds : e . ds 8 ss . ds v \h'-1'\o'\(aa\(ga' . ds _ \h'-1'^ . ds . \h'-1'. . ds 3 3 . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE . ds oe oe . ds Oe OE d129 4 d134 1 a134 1 iSelect -- Interactive Selection Tool d136 3 a138 2 \fBiselect\fR [\fB\-d\fR \fISTR\fR,\fISTR\fR] d143 2 a144 2 [\fB\-p\fR \fINUM\fR] [\fB\-k\fR \fIKEY\fR[:\fIOKEY\fR]] d146 2 a147 2 [\fB\-n\fR \fISTR\fR] [\fB\-t\fR \fISTR\fR] d151 1 a151 1 [\fB\-Q\fR \fISTR\fR] d154 1 a154 1 \fBiselect\fR d157 2 a158 1 1.2.0 (31-Mar-1999) d160 1 d162 1 d165 1 a165 1 interface frontend controlled by a Bourne-Shell, Perl or other type of script d170 1 d178 1 a178 1 construct ``\f(CW\fR...\f(CW\fR'\*(R' as in \s-1HTML\s0. d180 1 d182 2 a183 2 \fB\-m\fR). Per default no lines are selectable. If a line contains the string ``\f(CW\fR'\*(R' (or a string with different delimiters configured via d186 1 a186 1 without the ``\f(CW\fR'\*(R' string of course). If option \fB\-a\fR is used all d188 1 a188 1 option \fB\-a\fR is the same as adding ``\f(CW\fR'\*(R' to every line of the d190 2 a191 2 itself), you have to use the special variant ``\f(CW\fR'\*(R' which results in the output ``\f(CWresult text\fR'\*(R' when the corresponding line is d194 2 a195 2 When you use a specific result via ``\f(CW\fR'\*(R' the \fIresult text\fR can contain ``\f(CW%[query text]s\fR'\*(R' and ``\f(CW%[query text]S\fR'\*(R' d197 2 a198 2 result replaces the construct. The ``\f(CW%[query text]S\fR'\*(R' construct is like ``\f(CW%[query text]s\fR'\*(R' except that the empty string as the query result is not d205 3 a207 2 The output is the line itself or the string given with ``\f(CW\fR'\*(R'. When multiple line selection mode (option \fB\-m\fR) is used the d211 1 d213 1 d215 7 a221 5 .Ip "\fB\-d\fR \fI\s-1STR\s0\fR, \fB--delimiter=\fR\fI\s-1STR\s0\fR" 4 Sets the delimiters for the selection tags. The default is `\f(CW<,>\fR\*(R', i.e. the selection tags have to read ``\f(CW\fR'\*(R' and ``\f(CW\fR'\*(R' .Ip "\fB\-c\fR, \fB--strip-comments\fR" 4 d223 2 a224 1 .Ip "\fB\-f\fR, \fB--force-browse\fR" 4 d226 2 a227 1 .Ip "\fB\-a\fR, \fB--all-select\fR" 4 d229 2 a230 1 .Ip "\fB\-e\fR, \fB--exit-no-select\fR" 4 d234 3 a236 1 .Ip "\fB\-p\fR \fI\s-1NUM\s0\fR, \fB--position=\fR\fI\s-1NUM\s0\fR" 4 d238 6 a243 4 .Ip "\fB\-k\fR \fI\s-1KEY\s0\fR[:\fI\s-1OKEY\s0\fR], \fB--key=\fR\fI\s-1KEY\s0[:\fI\s-1OKEY\s0\fR]\fR" 4 Defines an additional input key. Per default \fI\s-1OKEY\s0\fR is \f(CWRETURN\fR, i.e. for instance \fB\-kf\fR defines another selection key `\f(CWf\fR\*(R'. .Ip "\fB\-m\fR, \fB--multi-line\fR" 4 d246 2 a247 1 .Ip "\fB\-n\fR \fI\s-1STR\s0\fR, \fB--name=\fR\fI\s-1STR\s0\fR" 4 d250 2 a251 1 .Ip "\fB\-t\fR \fI\s-1STR\s0\fR, \fB--title=\fR\fI\s-1STR\s0\fR" 4 d255 3 a257 1 .Ip "\fB\-S\fR, \fB--strip-result\fR" 4 d259 2 a260 1 .Ip "\fB\-K\fR, \fB--key-result\fR" 4 d262 1 a262 1 key which was used. This usually is \f(CWRETURN\fR or \f(CWKEY_RIGHT\fR but can be any d264 4 a267 3 select a line \f(CWFoo Bar\fR with key `\f(CWf\fR\*(R' the result string is ``\f(CWf:Foo Bar\fR'\*(R'. .Ip "\fB\-P\fR, \fB--position-result\fR" 4 d270 3 a272 2 the result \f(CWFoo Bar\fR configured the result string is ``\f(CWN:Foo Bar\fR'\*(R'. .Ip "\fB\-Q\fR \fI\s-1STR\s0\fR, \fB--quit-result=\fR\fI\s-1STR\s0\fR" 4 d275 3 a277 1 .Ip "\fB\-V\fR, \fB--version\fR" 4 d280 1 d282 1 d294 1 d304 1 d315 1 d318 1 a318 1 \fI$HOME/.bashrc\fR file) which enhance the built-in `\fIcd\fR\*(R' command of the d330 1 d344 2 a345 1 This new `\fIcd\fR\*(R' command is compatible with Bashs built-in variant for the case d347 1 a347 1 `\fIcd\fR\*(R' would immediately give an error (assuming we have no \fICDPATH\fR d351 1 a351 1 default result and `\fIcd\fR\*(R' then fails as usual with an error message. When d353 1 a353 1 `\fIcd\fR\*(R'. And only when more then one directory was found, iSelect opens its d355 1 a355 1 those directories. The chosen directory is then finally given to `\fIcd\fR\*(R'. d360 1 a360 1 .PP d367 1 a367 1 .PP a370 75 .rn }` '' .IX Title "ISELECT 1" .IX Name "iSelect - Interactive Selection Tool" .IX Header "NAME" .IX Header "SYNOPSIS" .IX Header "VERSION" .IX Header "DESCRIPTION" .IX Subsection "Intend" .IX Subsection "Input Data" .IX Subsection "Selections" .IX Subsection "Output Data" .IX Header "OPTIONS" .IX Subsection "Input Options" .IX Item "\fB\-d\fR \fI\s-1STR\s0\fR, \fB--delimiter=\fR\fI\s-1STR\s0\fR" .IX Item "\fB\-c\fR, \fB--strip-comments\fR" .IX Item "\fB\-f\fR, \fB--force-browse\fR" .IX Item "\fB\-a\fR, \fB--all-select\fR" .IX Item "\fB\-e\fR, \fB--exit-no-select\fR" .IX Subsection "Display Options" .IX Item "\fB\-p\fR \fI\s-1NUM\s0\fR, \fB--position=\fR\fI\s-1NUM\s0\fR" .IX Item "\fB\-k\fR \fI\s-1KEY\s0\fR[:\fI\s-1OKEY\s0\fR], \fB--key=\fR\fI\s-1KEY\s0[:\fI\s-1OKEY\s0\fR]\fR" .IX Item "\fB\-m\fR, \fB--multi-line\fR" .IX Item "\fB\-n\fR \fI\s-1STR\s0\fR, \fB--name=\fR\fI\s-1STR\s0\fR" .IX Item "\fB\-t\fR \fI\s-1STR\s0\fR, \fB--title=\fR\fI\s-1STR\s0\fR" .IX Subsection "Output Options" .IX Item "\fB\-S\fR, \fB--strip-result\fR" .IX Item "\fB\-K\fR, \fB--key-result\fR" .IX Item "\fB\-P\fR, \fB--position-result\fR" .IX Item "\fB\-Q\fR \fI\s-1STR\s0\fR, \fB--quit-result=\fR\fI\s-1STR\s0\fR" .IX Subsection "Giving Feedback" .IX Item "\fB\-V\fR, \fB--version\fR" .IX Header "KEYSTROKES" .IX Subsection "Cursor Movement" .IX Subsection "Line Selection" .IX Subsection "Others" .IX Header "EXAMPLE" .IX Header "AUTHOR" .IX Header "SEE ALSO" @ 1.1 log @Initial revision @ text @d96 1 a96 1 .TH ISELECT 1 "EN" "17/Sep/97" "Ralf S. Engelschall" d194 1 a194 2 [\fB\-p\fR \fINUM\fR] [\fB\-t\fR \fISTRING\fR] d196 1 a196 2 [\fB\-w\fR] [\fB\-l\fR] d198 3 a200 1 [\fB\-s\fR] d202 7 a208 3 [\fB\-d\fR \fISTRING\fR] [\fB\-e\fR] [\fISTRING\fR ...] d213 1 a213 1 1.0.0 (17-09-1997) d215 45 a259 2 iSelect is a Curses-based tool for interactive line selection in an ASCII file via a full-screen terminal session. d261 16 d279 4 a282 13 .Ip "\fB\-t\fR \fI\s-1STRING\s0\fR, \fB--title=\fR\fI\s-1STRING\s0\fR" 4 Sets the title bar string, displayed at the buttom of the browser window. .Ip "\fB\-c\fR, \fB--comment-strip\fR" 4 Strips all sharp comment lines from the input buffer before parsing. .Ip "\fB\-w\fR, \fB--whitespace-strip\fR" 4 Strips all leading and trailing whitespaces from the result string. .Ip "\fB\-l\fR, \fB--line-prefix\fR" 4 Prefix the result with the line number followed by a \*(L':\*(R'. .Ip "\fB\-a\fR, \fB--browse-always\fR" 4 Browse always, i.e. even when the input buffer contains no or only one line. .Ip "\fB\-m\fR, \fB--multi-select\fR" 4 d285 22 a306 6 .Ip "\fB\-s\fR, \fB--all-selectable\fR" 4 Force all lines to be selectable. .Ip "\fB\-d\fR, \fB--abort-string=\fR\fI\s-1STRING\s0\fR" 4 Sets the abort string. Default is no result. .Ip "\fB\-e\fR, \fB--exit-noselectable\fR" 4 Exit immediately if no lines are selectable. d309 73 d389 5 a393 2 .SH "SEEALSO" \fIncurses\fR\|(3) d407 8 d417 14 d433 3 a435 1 .IX Item "\fB\-t\fR \fI\s-1STRING\s0\fR, \fB--title=\fR\fI\s-1STRING\s0\fR" d437 1 a437 1 .IX Item "\fB\-c\fR, \fB--comment-strip\fR" d439 1 a439 1 .IX Item "\fB\-w\fR, \fB--whitespace-strip\fR" d441 1 a441 1 .IX Item "\fB\-l\fR, \fB--line-prefix\fR" d443 1 a443 1 .IX Item "\fB\-a\fR, \fB--browse-always\fR" d445 1 a445 1 .IX Item "\fB\-m\fR, \fB--multi-select\fR" d447 1 a447 1 .IX Item "\fB\-s\fR, \fB--all-selectable\fR" d449 1 a449 1 .IX Item "\fB\-d\fR, \fB--abort-string=\fR\fI\s-1STRING\s0\fR" d451 1 a451 1 .IX Item "\fB\-e\fR, \fB--exit-noselectable\fR" d455 10 d467 1 a467 1 .IX Header "SEEALSO" @ 1.1.1.1 log @Import iSelect 1.0.0 @ text @@ 1.1.1.2 log @Import iSelect 1.0.4 @ text @d96 1 a96 1 .TH ISELECT 1 "EN" "3/Jan/98" "Ralf S. Engelschall" d194 2 d197 2 a198 1 [\fB\-f\fR] d200 3 d204 1 a204 8 [\fB\-p\fR \fINUM\fR] [\fB\-m\fR] [\fB\-n\fR \fISTR\fR] [\fB\-t\fR \fISTR\fR] [\fB\-S\fR] [\fB\-P\fR] [\fB\-Q\fR \fISTR\fR] [\fIline1\fR \fIline2\fR ...] d209 1 a209 1 1.0.4 (03-01-1998) d211 2 a212 32 .Sh "Intend" iSelect is an interactive line selection tool for \s-1ASCII\s0 files, operating via a full-screen Curses-based terminal session. It can be used either as an user interface frontend controlled by a Bourne-Shell, Perl or other type of script backend as its wrapper or in batch as a pipe filter (usually between \fIgrep\fR and the final executing command). In other words: iSelect was designed to be used for any types of interactice line-based selections. .Sh "Input Data" Input is read either from the command line (\fIline1\fR \fIline2\fR ...) where each argument corresponds to one buffer line or from \fIstdin\fR (when no arguments are given) where the buffer lines are determined according to the newline characters. .Sh "Selections" The selection is either just a single line (default) or multiple lines (option \fB\-m\fR). Per default no lines are selectable. If a line contains the string ``\f(CW%%S%%\fR'\*(R' at any position this string is stripped and the line is selectable. Its result (printed to \fIstdout\fR) is the line contents itself (but without the ``\f(CW%%S%%\fR'\*(R' string of course). If option \fB\-a\fR is used all lines are selectable and their result is again the line itself, i.e. using option \fB\-a\fR is the same as adding ``\f(CW%%S%%\fR'\*(R' to every line of the input data. When you want a specific result (i.e. not just the line contents itself), you have to use the special variant ``\f(CW%%S:result text%%\fR'\*(R' which results in the output ``\f(CWresult text\fR'\*(R' when the corresponding line is selected. .PP The Curses-based full-screen selection is always done via \fI/dev/tty\fR, because the \fIstdin\fR and \fIstdout\fR filehandles are usually tied to the input and output data streams. .Sh "Output Data" The output is the line itself or the string given with ``\f(CW%%S:...%%\fR'\*(R'. When multiple line selection mode (option \fB\-m\fR) is used the output is all selected lines theirself or their configured result strings. Output always is written to \fIstdout\fR. a213 12 .Sh "Input Options" These options control how \fIiSelect\fR parses its input. .Ip "\fB\-c\fR, \fB--strip-comments\fR" 4 Strips all sharp comment lines from the input buffer before parsing. .Ip "\fB\-f\fR, \fB--force-browse\fR" 4 Browse always, i.e. even when the input buffer contains no or only one line. .Ip "\fB\-a\fR, \fB--all-select\fR" 4 Force all lines to be selectable. .Ip "\fB\-e\fR, \fB--exit-no-select\fR" 4 Exit immediately if no lines are selectable. In this case not even the Curses screen is initialized. .Sh "Display Options" d216 13 a228 1 .Ip "\fB\-m\fR, \fB--multi-line\fR" 4 d231 6 a236 16 .Ip "\fB\-n\fR \fI\s-1STR\s0\fR, \fB--name=\fR\fI\s-1STR\s0\fR" 4 Sets the name string, displayed flush left at the bottom of the browser window. .Ip "\fB\-t\fR \fI\s-1STR\s0\fR, \fB--title=\fR\fI\s-1STR\s0\fR" 4 Sets the title bar string, displayed centered at the bottom of the browser window. .Sh "Output Options" .Ip "\fB\-S\fR, \fB--strip-result\fR" 4 Strip all leading and trailing whitespaces from the result string. .Ip "\fB\-P\fR, \fB--position-result\fR" 4 Prefix the result string (given on \fIstdout\fR) with the corresponding cursor position followed by a colon. When you selected line \fIN\fR and this line has the result \f(CWFoo Bar\fR configured the result string is ``\f(CWN:Foo Bar\fR'\*(R'. .Ip "\fB\-Q\fR \fI\s-1STR\s0\fR, \fB--quit-result=\fR\fI\s-1STR\s0\fR" 4 Sets the result string on quit. Default is the empty string. .Sh "Giving Feedback" a238 73 .SH "KEYSTROKES" .Sh "Cursor Movement" Use these to browse through the selection list. .PP .Vb 6 \& CURSOR-UP ..... Move cursor one line up \& CURSOR-DOWN ... Move cursor one line down \& PAGE-UP ....... Move cursor one page up \& PAGE-DOWN ..... Move cursor one page down \& g ............. Goto first line \& G ............. Goto last line .Ve .Sh "Line Selection" Use these to select one line and exit in standard mode or one or more lines in multi-line mode. .PP .Vb 3 \& RETURN ........ Select line and exit \& CURSOR-RIGHT .. Select line and exit \& SPACE ......... Select line and stay (multi-line mode only) .Ve .Sh "Others" Use these to quit iSelect or to show its help and version page. .PP .Vb 4 \& q ............. Quit (exit without selection) \& CURSOR-LEFT ... Quit (exit without selection) \& h ............. Help Page \& v ............. Version Page .Ve .SH "EXAMPLE" As an example we present a real-life situation where iSelect can enhance an existing functionality. We define two Bash functions (for your \fI$HOME/.bashrc\fR file) which enhance the built-in `\fIcd\fR\*(R' command of the shell. .PP .Vb 7 \& # database scan for enhanced cd command \& cds () { \& (cd $HOME; \& find . -type d -print |\e \& sed -e "s;^\e.;$HOME;" |\e \& sort -u >$HOME/.cdpaths ) & \& } .Ve .Vb 11 \& # definition of the enhanced cd command \& cd () { \& if [ -d $1 ]; then \& builtin cd $1 \& else \& builtin cd `egrep "/$1[^/]*$" $HOME/.cdpaths |\e \& iselect -a -Q $1 -n "chdir" \e \& -t "Change Directory to..."` \& fi \& PS1="\eu@@\eh:$PWD\en:> " \& } .Ve This new `\fIcd\fR\*(R' command is compatible with Bashs built-in variant for the case where the specified directory actually exists. When it doesn't, the original `\fIcd\fR\*(R' would immediately give an error (assuming we have no \fICDPATH\fR variable defined). Here this enhanced version tries harder. First it searches for such a directory in a previously built (via \fIcds\fR) \fI$HOME/.cdpaths\fR files. When no line was found, iSelect just returns the given directory as the default result and `\fIcd\fR\*(R' then fails as usual with an error message. When only one directory was found, iSelect directly results this particular line to `\fIcd\fR\*(R'. And only when more then one directory was found, iSelect opens its Curses-based selection screen and lets the user choose interactively between those directories. The chosen directory is then finally given to `\fIcd\fR\*(R'. .PP For more useful examples on how to use iSelect, see the \fIcontrib/\fR directory of the iSelect distribution tarball. d246 2 a247 5 .SH "SEE ALSO" .PP .Vb 1 \& iSelect Home: http://www.engelschall.com/sw/iselect/ .Ve a260 8 .IX Subsection "Intend" .IX Subsection "Input Data" .IX Subsection "Selections" .IX Subsection "Output Data" d263 1 a263 3 .IX Subsection "Input Options" .IX Item "\fB\-c\fR, \fB--strip-comments\fR" d265 1 a265 1 .IX Item "\fB\-f\fR, \fB--force-browse\fR" d267 1 a267 1 .IX Item "\fB\-a\fR, \fB--all-select\fR" d269 1 a269 1 .IX Item "\fB\-e\fR, \fB--exit-no-select\fR" d271 1 a271 1 .IX Subsection "Display Options" d273 1 a273 9 .IX Item "\fB\-p\fR \fI\s-1NUM\s0\fR, \fB--position=\fR\fI\s-1NUM\s0\fR" .IX Item "\fB\-m\fR, \fB--multi-line\fR" .IX Item "\fB\-n\fR \fI\s-1STR\s0\fR, \fB--name=\fR\fI\s-1STR\s0\fR" .IX Item "\fB\-t\fR \fI\s-1STR\s0\fR, \fB--title=\fR\fI\s-1STR\s0\fR" .IX Subsection "Output Options" d275 1 a275 1 .IX Item "\fB\-S\fR, \fB--strip-result\fR" d277 1 a277 1 .IX Item "\fB\-P\fR, \fB--position-result\fR" d279 1 a279 1 .IX Item "\fB\-Q\fR \fI\s-1STR\s0\fR, \fB--quit-result=\fR\fI\s-1STR\s0\fR" d281 1 a281 1 .IX Subsection "Giving Feedback" a284 10 .IX Header "KEYSTROKES" .IX Subsection "Cursor Movement" .IX Subsection "Line Selection" .IX Subsection "Others" .IX Header "EXAMPLE" d287 1 a287 1 .IX Header "SEE ALSO" @ 1.1.1.3 log @Import iSelect 1.1.0 @ text @d96 1 a96 1 .TH ISELECT 1 "EN" "5/Apr/98" "Ralf S. Engelschall" a193 1 [\fB\-d\fR \fISTR\fR,\fISTR\fR] a198 1 [\fB\-k\fR \fIKEY\fR[:\fIOKEY\fR]] a202 1 [\fB\-K\fR] d210 1 a210 1 1.1.0 (05-04-1998) a223 4 .PP You can additionally let substrings displayed in Bold mode for non-selectable lines (because the selectable lines are always displayed bold) by using the construct ``\f(CW\fR...\f(CW\fR'\*(R' as in \s-1HTML\s0. d227 1 a227 2 ``\f(CW\fR'\*(R' (or a string with different delimiters configured via option \fB\-d\fR) at any position this string is stripped and the line is d229 6 a234 14 without the ``\f(CW\fR'\*(R' string of course). If option \fB\-a\fR is used all lines are selectable and their result is again the line itself, i.e. using option \fB\-a\fR is the same as adding ``\f(CW\fR'\*(R' to every line of the input data. When you want a specific result (i.e. not just the line contents itself), you have to use the special variant ``\f(CW\fR'\*(R' which results in the output ``\f(CWresult text\fR'\*(R' when the corresponding line is selected. .PP When you use a specific result via ``\f(CW\fR'\*(R' the \fIresult text\fR can contain ``\f(CW%s[query text]s\fR'\*(R' and ``\f(CW%s[query text]S\fR'\*(R' constructs. For every such construct an interactive query is done and the result replaces the construct. The ``\f(CW%s[query text]S\fR'\*(R' construct is like ``\f(CW%s[query text]s\fR'\*(R' except that the empty string as the query result is not accepted on input. d240 4 a243 4 The output is the line itself or the string given with ``\f(CW\fR'\*(R'. When multiple line selection mode (option \fB\-m\fR) is used the output is all selected lines theirself or their configured result strings. Output always is written to \fIstdout\fR. a246 4 .Ip "\fB\-d\fR \fI\s-1STR\s0\fR, \fB--delimiter=\fR\fI\s-1STR\s0\fR" 4 Sets the delimiters for the selection tags. The default is `\f(CW<,>\fR\*(R', i.e. the selection tags have to read ``\f(CW\fR'\*(R' and ``\f(CW\fR'\*(R' a258 3 .Ip "\fB\-k\fR \fI\s-1KEY\s0\fR[:\fI\s-1OKEY\s0\fR], \fB--key=\fR\fI\s-1KEY\s0[:\fI\s-1OKEY\s0\fR]\fR" 4 Defines an additional input key. Per default \fI\s-1OKEY\s0\fR is \f(CWRETURN\fR, i.e. for instance \fB\-kf\fR defines another selection key `\f(CWf\fR\*(R'. a270 6 .Ip "\fB\-K\fR, \fB--key-result\fR" 4 Prefix the result string (given on \fIstdout\fR) with the corresponding selection key which was used. This usually is \f(CWRETURN\fR or \f(CWKEY_RIGHT\fR but can be any of the additional keys defined by option \fB\-k\fR. When you use \fB\-kf\fR and select a line \f(CWFoo Bar\fR with key `\f(CWf\fR\*(R' the result string is ``\f(CWf:Foo Bar\fR'\*(R'. a389 2 .IX Item "\fB\-d\fR \fI\s-1STR\s0\fR, \fB--delimiter=\fR\fI\s-1STR\s0\fR" a401 2 .IX Item "\fB\-k\fR \fI\s-1KEY\s0\fR[:\fI\s-1OKEY\s0\fR], \fB--key=\fR\fI\s-1KEY\s0[:\fI\s-1OKEY\s0\fR]\fR" a410 2 .IX Item "\fB\-K\fR, \fB--key-result\fR" @ 1.1.1.4 log @Import iSelect 1.2.0 @ text @d96 1 a96 1 .TH ISELECT 1 "EN" "31/Mar/99" "Ralf S. Engelschall" d213 1 a213 1 1.2.0 (31-Mar-1999) @