# if I write
main > one two
# I should get new prompt
main\one\two >
####
my $term = new Term::ReadLine 'Command Line Interface';
my $attribs = $term->Attribs;
$attribs->{attempted_completion_function} = \&tabCompletionFunction;
sub tabCompletionFunction {
my ($text, $line, $start, $end) = @_;
my @tmp = split(/\s+/, $line);
unshift(@tmp, @prompt); # the completion should be relative to current prompt
$attribs->{completion_word} = &getTabCompletionArray(\@tmp);
return $term->completion_matches($text, $attribs->{list_completion_function});
}
####
$completionsArray = qw(one two three four); # found by &getTabCompletionArray
####
current prompt > xdd