| 1 | package Term::Complete;
|
|---|
| 2 | require 5.000;
|
|---|
| 3 | require Exporter;
|
|---|
| 4 |
|
|---|
| 5 | use strict;
|
|---|
| 6 | our @ISA = qw(Exporter);
|
|---|
| 7 | our @EXPORT = qw(Complete);
|
|---|
| 8 | our $VERSION = '1.402';
|
|---|
| 9 |
|
|---|
| 10 | # @(#)complete.pl,v1.2 ([email protected]) 09/23/91
|
|---|
| 11 |
|
|---|
| 12 | =head1 NAME
|
|---|
| 13 |
|
|---|
| 14 | Term::Complete - Perl word completion module
|
|---|
| 15 |
|
|---|
| 16 | =head1 SYNOPSIS
|
|---|
| 17 |
|
|---|
| 18 | $input = Complete('prompt_string', \@completion_list);
|
|---|
| 19 | $input = Complete('prompt_string', @completion_list);
|
|---|
| 20 |
|
|---|
| 21 | =head1 DESCRIPTION
|
|---|
| 22 |
|
|---|
| 23 | This routine provides word completion on the list of words in
|
|---|
| 24 | the array (or array ref).
|
|---|
| 25 |
|
|---|
| 26 | The tty driver is put into raw mode and restored using an operating
|
|---|
| 27 | system specific command, in UNIX-like environments C<stty>.
|
|---|
| 28 |
|
|---|
| 29 | The following command characters are defined:
|
|---|
| 30 |
|
|---|
| 31 | =over 4
|
|---|
| 32 |
|
|---|
| 33 | =item E<lt>tabE<gt>
|
|---|
| 34 |
|
|---|
| 35 | Attempts word completion.
|
|---|
| 36 | Cannot be changed.
|
|---|
| 37 |
|
|---|
| 38 | =item ^D
|
|---|
| 39 |
|
|---|
| 40 | Prints completion list.
|
|---|
| 41 | Defined by I<$Term::Complete::complete>.
|
|---|
| 42 |
|
|---|
| 43 | =item ^U
|
|---|
| 44 |
|
|---|
| 45 | Erases the current input.
|
|---|
| 46 | Defined by I<$Term::Complete::kill>.
|
|---|
| 47 |
|
|---|
| 48 | =item E<lt>delE<gt>, E<lt>bsE<gt>
|
|---|
| 49 |
|
|---|
| 50 | Erases one character.
|
|---|
| 51 | Defined by I<$Term::Complete::erase1> and I<$Term::Complete::erase2>.
|
|---|
| 52 |
|
|---|
| 53 | =back
|
|---|
| 54 |
|
|---|
| 55 | =head1 DIAGNOSTICS
|
|---|
| 56 |
|
|---|
| 57 | Bell sounds when word completion fails.
|
|---|
| 58 |
|
|---|
| 59 | =head1 BUGS
|
|---|
| 60 |
|
|---|
| 61 | The completion character E<lt>tabE<gt> cannot be changed.
|
|---|
| 62 |
|
|---|
| 63 | =head1 AUTHOR
|
|---|
| 64 |
|
|---|
| 65 | Wayne Thompson
|
|---|
| 66 |
|
|---|
| 67 | =cut
|
|---|
| 68 |
|
|---|
|
|---|