CTK::CLI - Command line interface
Version 1.71
my $v = $c->cli_prompt('Your name:', 'anonymous'); debug( "Your name: $v" ); my $v = $c->cli_prompt3('Your name:'); debug( "Your name: $v" ); my $v = $c->cli_select('Your select:',[qw/foo bar baz/],'bar'); debug( "Your select: $v" ); my $v = $c->cli_select3('Your select:',[qw/foo bar baz/]); debug( "Your select: $v" );
Command line interface. Prompt and select methods
my $v = $c->cli_prompt('Your name:', 'anonymous'); debug( "Your name: $v" ); my $v = $c->cli_prompt3('Your name:'); debug( "Your name: $v" );
Show prompt string for typing data. The second method asks for data entry three times in case of incorrect attempts
my $v = $c->cli_select('Your select:',[qw/foo bar baz/],'bar'); debug( "Your select: $v" ); my $v = $c->cli_select3('Your select:',[qw/foo bar baz/]); debug( "Your select: $v" );
Show prompt string for select item. The second method asks for data entry three times in case of incorrect attempts
* Use Term::ReadLine module. Sample: BEGIN { $ENV{TERM} = "dumb" if $^O eq "MSWin32" } use Term::ReadLine (); use Text::ParseWords qw(shellwords); my $term = new Term::ReadLine 'T01'; my $prompt = "T> "; my $OUT = $term->OUT || \*STDOUT; while ( defined ($_ = $term->readline($prompt)) ) { last if /^(quit|exit)$/; my @w = shellwords($_); if (@w) { print join(" ",@w),"\n"; $term->addhistory($_); } } print "\n";
Sergey Lepenkov (Serz Minus) http://www.serzik.com <minus@mail333.com>
Copyright (C) 1998-2017 D&D Corporation. All Rights Reserved
This program is free software; you can redistribute it and/or modify it under the same terms and conditions as Perl itself.
This program is distributed under the GNU LGPL v3 (GNU Lesser General Public License version 3).
See LICENSE file
LICENSE
To install CTK, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CTK
CPAN shell
perl -MCPAN -e shell install CTK
For more information on module installation, please visit the detailed CPAN module installation guide.