App-AltSQL
view release on metacpan or search on metacpan
lib/App/AltSQL.pm view on Meta::CPAN
=item B<%d>
The current database or '(none)'
=item B<%h>
The hostname the model is connected to
=item B<%%>
An escaped percent sign
=item B<%c{...}>
A L<Term::ANSIColor> color name. The value will be passed directly to the C<color> method.
=item B<%e{...}>
A block to be eval'ed. You may use $self to refer to the L<App::AltSQL::Term> object
=item B<%t{...}>
t/003_custom_prompt.t view on Meta::CPAN
#$model->setup();
#$term->setup();
## Testing
$term->prompt('myprompt> ');
is $term->render_prompt(), 'myprompt> ', "Basic, non-special prompt";
$term->prompt('myprompt%%> ');
is $term->render_prompt(), 'myprompt%> ', "Escaped percent sign";
$term->prompt('%u@%h> ');
is $term->render_prompt(), 'testuser@localhost> ', "Some substitutions";
$term->prompt('(%u@%h) [%d]> ');
is $term->render_prompt(), '(testuser@localhost) [(none)]> ', "Issue #28, without database";
$model->current_database('saklia');
$term->prompt('(%u@%h) [%d]> ');
( run in 0.453 second using v1.01-cache-2.11-cpan-10c994e2082 )