view release on metacpan or search on metacpan
lib/App/PerlCriticUtils.pm view on Meta::CPAN
default_severity => 5,
applies_to => "PPI::Token::Word",
},
{
name => "InputOutput::ProhibitExplicitStdin",
abstract => "Use \"<>\" or \"<ARGV>\" or a prompting module instead of \"<STDIN>\".",
supported_parameters => "",
applies_to => "PPI::Token::QuoteLike::Readline",
default_themes => "core, pbp, maintenance",
default_severity => 4,
},
{
name => "InputOutput::ProhibitInteractiveTest",
abstract => "Use prompt() instead of -t.",
applies_to => "PPI::Token::Operator",
default_themes => "core, pbp, bugs, certrule",
default_severity => 5,
supported_parameters => "",
},
lib/App/PerlCriticUtils.pm view on Meta::CPAN
default_severity => 5,
default_themes => "core, pbp, bugs, certrec",
},
{
name => "InputOutput::ProhibitInteractiveTest",
abstract => "Use prompt() instead of -t.",
default_severity => 5,
default_themes => "core, pbp, bugs, certrule",
applies_to => "PPI::Token::Operator",
supported_parameters => "",
},
lib/App/PerlCriticUtils.pm view on Meta::CPAN
default_themes => "core, pbp, bugs, certrec",
applies_to => "PPI::Token::Word",
},
{
name => "InputOutput::ProhibitExplicitStdin",
abstract => "Use \"<>\" or \"<ARGV>\" or a prompting module instead of \"<STDIN>\".",
default_severity => 4,
default_themes => "core, pbp, maintenance",
applies_to => "PPI::Token::QuoteLike::Readline",
supported_parameters => "",
},
{
name => "InputOutput::ProhibitInteractiveTest",
abstract => "Use prompt() instead of -t.",
default_severity => 5,
default_themes => "core, pbp, bugs, certrule",
applies_to => "PPI::Token::Operator",
supported_parameters => "",
},
view all matches for this distribution
view release on metacpan or search on metacpan
bin/plsh.pl view on Meta::CPAN
'E|exit!' => \$opt{exit},
'feature=s' => \$opt{feature},
'Include=s@' => \$opt{include},
'lexical!' => \$opt{lexical},
'P|package=s' => \$opt{package},
'p|prompt=s' => \$opt{prompt},
'session=s' => \$opt{session},
'V|verbose!' => \$opt{verbose},
# 'words!' => \$opt{words},
'help!' => \$opt{help},
'man!' => \$opt{man},
bin/plsh.pl view on Meta::CPAN
}
$params{execute} .= "\n";
}
}
if ( defined $opt{prompt} ) {
$params{prompt} = $opt{prompt};
$params{execute} .= "\$ENV{PERLSHELL_PROMPT}='$opt{prompt}';\n";
}
# Must be here again to add to end of execute to override .plshrc setting
# of package with the command line -P if specified
if ( defined $opt{package} ) {
bin/plsh.pl view on Meta::CPAN
-P package Package to use as namespace. Will:
--package use `package';
before any -e arguments.
-p prompt Prompt for the shell.
--prompt
-s file Session command log file.
--session
-V Output verbose initialization information.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Phoebe/Chat.pm view on Meta::CPAN
The URL will look something like this:
C<gemini://localhost/do/chat/listen> or
C<gemini://localhost/space/do/chat/listen>
The I<Say URL> is where you post things you want to say: point your client at
the URL, it prompts your for something to say, and once you do, it redirects you
to the same URL again, so you can keep saying things.
The URL will look something like this: C<gemini://localhost/do/chat/say> or
C<gemini://localhost/space/do/chat/say>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/PhotoDB.pm view on Meta::CPAN
photodb [OPTIONS]
=head1 OPTIONS
PhotoDB uses a config file to store database connection info. You will be prompted to create this file on first run. However, you can override this by
specifying database connection info as command line options. It is only recommended to do this for local testing. If you specify these database connection
options, you must specify either ALL of them or NONE of them.
=over
lib/App/PhotoDB.pm view on Meta::CPAN
Out of the box, PhotoDB is mostly empty, ready for you to enter your own data. However if you install PhotoDB in the recommended way, it comes with some pre-
filled data e.g. about manufacturers, film emulsions, film sizes, metering modes, etc, to get you up and running faster. In many cases you'll want to add to
this data to suit your own needs but you shouldn't need to edit anything that already exists.
The command C<data> has subcommands for adding various pieces of data. Normally, you shouldn't need to go out of your way to add this type of data, as PhotoDB
will prompt you if you need to add any while adding cameras, lenses, films, etc.
=head3 Unique identifiers
Every object registered in PhotoDB (e.g. camera, lenses, films, negatives, etc) is allocated a unique ID number, starting at 1 and counting up. This number is
used to reference other objects. This number is often prefixed with a C<#> for readability, e.g. _Film #99_.
lib/App/PhotoDB.pm view on Meta::CPAN
There are three methods for connecting to the database:
1. Database and application on same computer
2. Database and application on different computers, connect via native MySQL
3. Database and application on different computers, connect via SSH tunnel
The app and accessory scripts need to know how to connect to the database. The first time you run PhotoDB, you will be prompted to enter connection details for
the database backend. If you need to edit the config in future, the config file is created at C</etc/photodb.ini>.
=head3 Tunnelling
If the database is on a remote server and does not have the MySQL port (3306) open to receive connections, you will need to set up a tunnel. Run the command
lib/App/PhotoDB.pm view on Meta::CPAN
my $db = &db({args=>$args});
# Set up terminal
our $term = &term;
# Enter interactive prompt and loop until exited by user
while (1) {
my $rv = &prompt({prompt=>'photodb', type=>'text', showtype=>0, showdefault=>0, char=>'>'});
# Trap important keywords first
if ($rv eq 'exit' || $rv eq 'quit') {
last;
} elsif ($rv =~ /^(\w+) ?([\w-]+)?$/) {
# Match a command and an optional subcommand
view all matches for this distribution
view release on metacpan or search on metacpan
script/pick view on Meta::CPAN
# code => {},
# is_flag => {},
# },
# },
# cmdline_on_getopt => {},
# cmdline_prompt => {},
# completion => {},
# index_completion => {},
# element_completion => {},
# cmdline_src => {},
# meta => 'fix',
view all matches for this distribution
view release on metacpan or search on metacpan
t/files/moby11.txt view on Meta::CPAN
But even this wears off in time.
What of it, if some old hunks of a sea-captain orders me to get
a broom and sweep down the decks? What does that indignity amount to,
weighed, I mean, in the scales of the New Testament? Do you think
the archangel Gabriel thinks anything the less of me, because I promptly
and respectfully obey that old hunks in that particular instance?
Who ain't a slave? Tell me that. Well, then, however the old
sea-captains may order me about--however they may thump and punch
me about, I have the satisfaction of knowing that it is all right;
that everybody else is one way or other served in much the same way--
t/files/moby11.txt view on Meta::CPAN
A division which, in the whale, is much like halving an apple; there is
no intermediate remainder. Now as this law, under a modified form,
is to this day in force in England; and as it offers in various respects
a strange anomaly touching the general law of Fast--and Loose-Fish,
it is here treated of in a separate chapter, on the same courteous
principle that prompts the English railways to be at the expense of a
separate car, specially reserved for the accommodation of royalty.
In the first place, in curious proof of the fact that the above-mentioned
law is still in force, I proceed to lay before you a circumstance-that
happened within the last two years.
t/files/moby11.txt view on Meta::CPAN
whatever it might include. There was some heathenish,
coffin-colored old lumber aboard, which, upon a long previous voyage,
had been cut from the aboriginal groves of the Lackaday islands,
and from these dark planks the coffin was recommended to be made.
No sooner was the carpenter apprised of the order, than taking
his rule, he forthwith with all the indifferent promptitude
of his character, proceeded into the forecastle and took
Queequeg's measure with great accuracy, regularly chalking
Queequeg's person as he shifted the rule.
"Ah! poor fellow! he'll have to die now," ejaculated the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Pimpd/Playlist.pm view on Meta::CPAN
Parameters: @playlists
Tries hard to find valid, existing playlists based on input.
If a playlist doesn't exist, tries to match the strings against the existing
ones (using B<get_valid_lists()> from B<App::Pimpd::Validate>), presenting
the user with a prompt.
get_valid_lists() returns a list of valid playlists which we add to the current
playlist.
=item play_pos_from_playlist()
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Plex/Archiver.pm view on Meta::CPAN
my $menu = [];
for my $movie (@responses) {
push(@$menu, sprintf("\"%s\" (%s)", $movie->{title}, $movie->{release_year}));
}
if (scalar(@$menu)) {
my $selected = prompt(
"Matching titles ...",
-menu => $menu,
-number,
"Your choice: "
);
lib/App/Plex/Archiver.pm view on Meta::CPAN
=item * L<Carp> - Error handling
=item * L<Lingua::EN::Titlecase> - Title case formatting
=item * L<IO::Prompter> - Interactive user prompts
=item * L<Readonly> - Read-only variables
=item * L<TMDB> - The Movie Database API integration (external dependency)
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
$AllDeps = 1;
}
}
}
# overrides MakeMaker's prompt() to automatically accept the default choice
sub _prompt {
goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
my ( $prompt, $default ) = @_;
my $y = ( $default =~ /^[Yy]/ );
print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
print "$default\n";
return $default;
}
# the workhorse
inc/Module/AutoInstall.pm view on Meta::CPAN
map { +{@args}->{$_} }
grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} }
)[0]
);
# We want to know if we're under CPAN early to avoid prompting, but
# if we aren't going to try and install anything anyway then skip the
# check entirely since we don't want to have to load (and configure)
# an old CPAN just for a cosmetic message
$UnderCPAN = _check_lock(1) unless $SkipInstall;
inc/Module/AutoInstall.pm view on Meta::CPAN
!$SkipInstall
and (
$CheckOnly
or ($mandatory and $UnderCPAN)
or $AllDeps
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
. ( $mandatory ? ' mandatory' : ' optional' )
. qq{ module(s) from CPAN?},
$default ? 'y' : 'n',
inc/Module/AutoInstall.pm view on Meta::CPAN
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
inc/Module/AutoInstall.pm view on Meta::CPAN
return
if _version_cmp( _load($class), $ver ) >= 0; # no need to upgrade
if (
_prompt( "==> A newer version of $class ($ver) is required. Install?",
'y' ) =~ /^[Nn]/
)
{
die "*** Please install $class $ver manually.\n";
}
inc/Module/AutoInstall.pm view on Meta::CPAN
# check if we're connected to some host, using inet_aton
sub _connected_to {
my $site = shift;
return (
( _load('Socket') and Socket::inet_aton($site) ) or _prompt(
qq(
*** Your host cannot resolve the domain name '$site', which
probably means the Internet connections are unavailable.
==> Should we try to install the required module(s) anyway?), 'n'
) =~ /^[Yy]/
inc/Module/AutoInstall.pm view on Meta::CPAN
*** You are not allowed to write to the directory '$path';
the installation may fail due to insufficient permissions.
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
inc/Module/AutoInstall.pm view on Meta::CPAN
print << ".";
*** The 'sudo' command exited with error! Resuming...
.
}
return _prompt(
qq(
==> Should we try to install the required module(s) anyway?), 'n'
) =~ /^[Yy]/;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
sub Makefile { $_[0] }
my %seen = ();
sub prompt {
shift;
# Infinite loop protection
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
# Store a cleaned up version of the MakeMaker version,
# since we need to behave differently in a variety of
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Pods2Site.pod view on Meta::CPAN
Version 1.003
=head1 SYNOPSIS
# Normally run 'pods2site' from a shell prompt to create or update:
# (place a site in the perl tree)
#
pods2site :std
# or an explicit site root
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Presto.pm view on Meta::CPAN
args => "[-c] [-d] [number]",
method => sub { shift->history_call(@_) },
doc => "Specify a number to list the last N lines of history Pass -c to clear the command history, -d NUM to delete a single item\n",
},
},
prompt => sprintf( '%s> ', $self->endpoint ),
history_file => $self->config->file('history'),
);
$term->ornaments('md,me,,');
return $term;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PrimaX/InputHistory.pm view on Meta::CPAN
return {
%def,
pageLines => 10, # lines to 'scroll' with pageup/pagedown
accelItems => \@acc,
outputWidget => ih::StdOut,
promptFormat => '> ',
currentLine => 0,
storeType => ih::All,
}
}
lib/PrimaX/InputHistory.pm view on Meta::CPAN
# for (1) setting the properties above (2) loading the history file data, and
# (3) connecting to the output widget.
sub init {
my $self = shift;
my %profile = $self->SUPER::init(@_);
foreach ( qw(pageLines promptFormat currentLine outputWidget storeType) ) {
$self->{$_} = $profile{$_};
}
# Store the history and revisions:
$self->currentRevisions([]);
lib/PrimaX/InputHistory.pm view on Meta::CPAN
# name example property code:
sub pageLines {
return $_[0]->{pageLines} unless $#_;
$_[0]->{pageLines} = $_[1];
}
sub promptFormat {
return $_[0]->{promptFormat} unless $#_;
$_[0]->{promptFormat} = $_[1];
}
sub outputWidget {
return $_[0]->{outputWidget} unless $#_;
$_[0]->{outputWidget} = $_[1];
}
lib/PrimaX/InputHistory.pm view on Meta::CPAN
# Reset the current collection of revisions:
$self->{currentRevisions} = [];
# print this line:
$self->outputWidget->newline_printout($self->promptFormat, $text, "\n");
# We are about to add this text to the history. Before doing so, check if
# the history needs to be modified before performing the add:
if ($self->storeType == ih::NoRepeat
and defined $self->history->[-1]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Project/Doctor/Fixer.pm view on Meta::CPAN
package App::Project::Doctor::Fixer;
# The Fixer presents a numbered menu of auto-fixable findings, reads the
# user's answer from STDIN, and calls each selected fix coderef with the
# current Context. In non-interactive mode (--fix flag) it applies all
# fixes immediately without prompting.
use strict;
use warnings;
use autodie qw(:all);
lib/App/Project/Doctor/Fixer.pm view on Meta::CPAN
# The Report whose fixable findings will be presented to the user.
sub report { $_[0]->{report} }
# The Context passed to each fix coderef so it can find files.
sub context { $_[0]->{context} }
# When true, all fixes are applied immediately without user prompting.
sub non_interactive { $_[0]->{non_interactive} }
# ---------------------------------------------------------------------------
# Public interface
# ---------------------------------------------------------------------------
=head2 run
Presents fixable findings, prompts (or auto-applies in non-interactive mode),
and calls each selected C<fix> coderef. Returns the count of fixes applied.
=cut
sub run {
my $self = shift;
# Collect only the findings that have an associated fix coderef.
my @fixable = $self->report->fixable;
# Nothing to do if no fixable findings were found.
return 0 unless @fixable;
# Choose the right mode: silent auto-apply vs. interactive prompt.
return $self->non_interactive
? $self->_apply_all(\@fixable)
: $self->_interactive_loop(\@fixable);
}
lib/App/Project/Doctor/Fixer.pm view on Meta::CPAN
Presents fixable findings from a report, reads the user's choice from STDIN
(C<Y> all, C<n> none, or C<1,3> index list), and calls each selected
finding's C<fix> coderef with the current context.
Set C<non_interactive =E<gt> 1> to apply all fixes without prompting
(C<--fix> mode).
=head1 CONSTRUCTOR
=head2 new( %args )
lib/App/Project/Doctor/Fixer.pm view on Meta::CPAN
run : Fixer -> N
run fixer ==
let fixable = { f in findings (report fixer) | is_fixable f }
in if non_interactive fixer
then apply_all fixable
else apply_chosen fixable (prompt fixable)
=head1 LIMITATIONS
Reads from STDIN; use C<non_interactive =E<gt> 1> in automated pipelines.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Prolix.pm view on Meta::CPAN
sub try_user_input {
my($self) = @_;
return if not defined Term::ReadKey::ReadKey(-1);
# Enter interactive prompt mode. We hope this will be brief, and
# IPC::Run can buffer our watched command in the meanhwile.
say q{Press ENTER to go back, or enter "help" for a list of commands.}
if $self->verbose;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
sub Makefile { $_[0] }
my %seen = ();
sub prompt {
shift;
# Infinite loop protection
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
# Store a cleaned up version of the MakeMaker version,
# since we need to behave differently in a variety of
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Prove/Elasticsearch/Planner/Default.pm view on Meta::CPAN
die "check_index not run, ES object not defined!" unless $e;
my %out = %options;
$out{pairwise} = $out{pairwise} ? "true" : "false";
delete $out{show};
delete $out{prompt};
delete $out{allplatforms};
delete $out{exts};
delete $out{recurse};
delete $out{name} unless $out{name};
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
$AllDeps = 1;
}
}
}
# overrides MakeMaker's prompt() to automatically accept the default choice
sub _prompt {
goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
my ( $prompt, $default ) = @_;
my $y = ( $default =~ /^[Yy]/ );
print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
print "$default\n";
return $default;
}
# the workhorse
inc/Module/AutoInstall.pm view on Meta::CPAN
map { +{@args}->{$_} }
grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} }
)[0]
);
# We want to know if we're under CPAN early to avoid prompting, but
# if we aren't going to try and install anything anyway then skip the
# check entirely since we don't want to have to load (and configure)
# an old CPAN just for a cosmetic message
$UnderCPAN = _check_lock(1) unless $SkipInstall;
inc/Module/AutoInstall.pm view on Meta::CPAN
!$SkipInstall
and (
$CheckOnly
or ($mandatory and $UnderCPAN)
or $AllDeps
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
. ( $mandatory ? ' mandatory' : ' optional' )
. qq{ module(s) from CPAN?},
$default ? 'y' : 'n',
inc/Module/AutoInstall.pm view on Meta::CPAN
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
inc/Module/AutoInstall.pm view on Meta::CPAN
return
if _version_cmp( _load($class), $ver ) >= 0; # no need to upgrade
if (
_prompt( "==> A newer version of $class ($ver) is required. Install?",
'y' ) =~ /^[Nn]/
)
{
die "*** Please install $class $ver manually.\n";
}
inc/Module/AutoInstall.pm view on Meta::CPAN
# check if we're connected to some host, using inet_aton
sub _connected_to {
my $site = shift;
return (
( _load('Socket') and Socket::inet_aton($site) ) or _prompt(
qq(
*** Your host cannot resolve the domain name '$site', which
probably means the Internet connections are unavailable.
==> Should we try to install the required module(s) anyway?), 'n'
) =~ /^[Yy]/
inc/Module/AutoInstall.pm view on Meta::CPAN
*** You are not allowed to write to the directory '$path';
the installation may fail due to insufficient permissions.
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
inc/Module/AutoInstall.pm view on Meta::CPAN
print << ".";
*** The 'sudo' command exited with error! Resuming...
.
}
return _prompt(
qq(
==> Should we try to install the required module(s) anyway?), 'n'
) =~ /^[Yy]/;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
$AllDeps = 1;
}
}
}
# overrides MakeMaker's prompt() to automatically accept the default choice
sub _prompt {
goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
my ( $prompt, $default ) = @_;
my $y = ( $default =~ /^[Yy]/ );
print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
print "$default\n";
return $default;
}
# the workhorse
inc/Module/AutoInstall.pm view on Meta::CPAN
map { +{@args}->{$_} }
grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} }
)[0]
);
# We want to know if we're under CPAN early to avoid prompting, but
# if we aren't going to try and install anything anyway then skip the
# check entirely since we don't want to have to load (and configure)
# an old CPAN just for a cosmetic message
$UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget;
inc/Module/AutoInstall.pm view on Meta::CPAN
and (
$CheckOnly
or ($mandatory and $UnderCPAN)
or $AllDeps
or $InstallDepsTarget
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
. ( $mandatory ? ' mandatory' : ' optional' )
. qq{ module(s) from CPAN?},
$default ? 'y' : 'n',
inc/Module/AutoInstall.pm view on Meta::CPAN
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
inc/Module/AutoInstall.pm view on Meta::CPAN
return
if _version_cmp( _version_of($class), $ver ) >= 0; # no need to upgrade
if (
_prompt( "==> A newer version of $class ($ver) is required. Install?",
'y' ) =~ /^[Nn]/
)
{
die "*** Please install $class $ver manually.\n";
}
inc/Module/AutoInstall.pm view on Meta::CPAN
# check if we're connected to some host, using inet_aton
sub _connected_to {
my $site = shift;
return (
( _load('Socket') and Socket::inet_aton($site) ) or _prompt(
qq(
*** Your host cannot resolve the domain name '$site', which
probably means the Internet connections are unavailable.
==> Should we try to install the required module(s) anyway?), 'n'
) =~ /^[Yy]/
inc/Module/AutoInstall.pm view on Meta::CPAN
*** You are not allowed to write to the directory '$path';
the installation may fail due to insufficient permissions.
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
inc/Module/AutoInstall.pm view on Meta::CPAN
print << ".";
*** The 'sudo' command exited with error! Resuming...
.
}
return _prompt(
qq(
==> Should we try to install the required module(s) anyway?), 'n'
) =~ /^[Yy]/;
}
view all matches for this distribution
view release on metacpan or search on metacpan
bin/dev/openapi_json_to_perl.pl view on Meta::CPAN
my $x = <<'END';
{
"model": "code-davinci-002",
"prompt": "# Python to Perl\nPython:\n\n for test_index in self._iter_test_masks(X, y, groups):\n test_var = \"test data\"\n train_index = indices[np.logical_not(test_index)]\n\nPerl:",
"temperature": 0,
"max_tokens": 256,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
view all matches for this distribution
view release on metacpan or search on metacpan
statements, subroutine definitions, &c.
4. ... all on a single line? :-/
No. Again, it uses PPI to try and determine if your Perl is
complete, and if not it will continue to prompt you for the
rest.
5. Tries to?
Well, Perl isn't Python :-) Without imposing annoying restrictions,
view all matches for this distribution
view release on metacpan or search on metacpan
0.2.22 2016-05-24 13:57:04 CST
- Fix command compare
0.2.21 2016-05-24 13:50:18 CST
- Clean prompts
0.2.20 2016-05-24 13:33:26 CST
- Command span handles stdin
0.2.19 2016-05-24 09:16:47 CST
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
sub Makefile { $_[0] }
my %seen = ();
sub prompt {
shift;
# Infinite loop protection
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
# Store a cleaned up version of the MakeMaker version,
# since we need to behave differently in a variety of
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
sub Makefile { $_[0] }
my %seen = ();
sub prompt {
shift;
# Infinite loop protection
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
# Store a cleaned up version of the MakeMaker version,
# since we need to behave differently in a variety of
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Rad/Plugin/ReadLine.pm view on Meta::CPAN
our $GreetWithCommand = 'help'; # when the shell starts, run this command
our $GreetWithSub ; # you can pass in a sub too, both GreetWith's are run
our $DefaultCommand = '' ;
our $ShellPrompt = "[" . $0 . "]";
# we keep prompting until this is false
# (we register "exit" as a command to set it to 0 upon entering shell)
our $still_going = 1;
use Term::UI;
lib/App/Rad/Plugin/ReadLine.pm view on Meta::CPAN
our $term;
sub _terminal {
$term ||= Term::ReadLine->new($ENV{TERM} || 'critter');
}
sub _shell_prompt {
# add a space to the end
$ShellPrompt =~ / $/? $ShellPrompt : "$ShellPrompt "
}
sub _shell_help { "run $0 in interactive mode" };
sub _shell_command { 'shell' }
lib/App/Rad/Plugin/ReadLine.pm view on Meta::CPAN
$c->$welcome();
while($still_going) {
(my $cmd, local @ARGV) = split ' ',
_terminal->get_reply(
prompt => _shell_prompt(),
default => $DefaultCommand,
);
if (defined $cmd and $cmd ne '') {
@{$c->argv} = @ARGV;
$c->{'cmd'} = $cmd;
lib/App/Rad/Plugin/ReadLine.pm view on Meta::CPAN
App::Rad->run();
sub turtles :Help('do it in the shell'){
my $c = shift;
$c->shell({
GreetWithCommand => '', # use what App::Rad decides is the default
ShellPrompt => 'c/,,\\' # ascii turtle for the prompt
});
}
#end of listing
lib/App/Rad/Plugin/ReadLine.pm view on Meta::CPAN
C<GreetWithSub> => run this sub-ref (as a method on $c) when the shell starts
C<DefaultCommand> => if the user doesn't enter a command, they entered this.
'' will use App::Rad's default command.
C<ShellPrompt> => what to prompt the user with, defautl is "$0 "
=head3 C<[$command_name, [ $command_help ]]>:
C<$command_name> is the name of the sub-comamnd name
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Raider.pm view on Meta::CPAN
API key for the engine. Defaults to an engine-appropriate environment variable.
=head2 mission
System prompt / mission statement for the Raider. Defaults to a generic
assistant persona.
=head2 root
Working directory for tool operations. Defaults to the current process cwd.
lib/App/Raider.pm view on Meta::CPAN
results) via L<App::Raider::Plugin::Trace>. Defaults to on when STDOUT is a
terminal.
=head2 max_context_tokens
Trigger history auto-compression once the last prompt exceeds
C<context_compress_threshold * max_context_tokens>. Defaults to 40_000, which
keeps the running session comfortably under typical per-minute rate limits
(Anthropic org default: 50k input tokens/min on Haiku).
=head2 context_compress_threshold
lib/App/Raider.pm view on Meta::CPAN
(e.g. C<temperature>, C<response_size>, C<seed>). Merged on top of values
loaded from C<.raider.yml> in the working directory.
=head2 raid_f
my $result = await $app->raid_f($prompt);
Async variant: drives one raid iteration and returns the
L<Langertha::Raider::Result>.
=head2 run
my $result = $app->run($prompt);
Synchronous convenience wrapper around L</raid_f>. Runs the I/O loop until the
raid completes and returns the result (which stringifies to the final text).
=head2 raider
lib/App/Raider.pm view on Meta::CPAN
are NOT covered by the current L</skill_sources>. Intended to power the
banner's "seeing AGENTS.md, ignoring" notice.
=head2 token_stats
Cumulative token counts for this session (hashref with C<prompt>,
C<completion>, C<total>, C<calls>) â available when trace is enabled.
=head2 reload_mission
Rebuilds the mission (e.g. after C<.raider.md> has been edited) and swaps it
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Rakubrew/Shell/Cmd.pm view on Meta::CPAN
if "!cmd!" == "!cmd:/=!" (
endlocal
FOR /f "delims=" \%\%i in ('"$brew_exec" init Cmd') do \@\%\%i
)
You can easily do that from a CMD prompt using the following command:
(
echo \@echo off
echo setlocal EnableDelayedExpansion
echo set "cmd=!cmdcmdline!"
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/RecordStream.pm view on Meta::CPAN
You can also install recs from L<CPAN|http://cpan.org> as App::RecordStream:
cpanm --interactive App::RecordStream
Using L<cpanm> in interactive mode will prompt you for optional feature
support. Other CPAN clients such as L<cpan> and L<cpanp> also work fine, but
you can't opt to use any optional features (just like cpanm in non-interactive
mode). A kitchen-sink install of App::RecordStream looks like:
cpanm --with-recommends --with-all-features App::RecordStream
view all matches for this distribution
view release on metacpan or search on metacpan
share/ppt/rm.pl view on Meta::CPAN
sub removeFile( $fileName )
{
my ( $fileName ) = @_;
my $reply;
# If its read only, and we're not forcing, and interactive prompt for deletion
#
if ( ( ! -w $fileName ) && ( !$opt_f ) && ( $opt_i ))
{
print "$fileName: Read-only ? ";
$reply = <STDIN>;
share/ppt/rm.pl view on Meta::CPAN
{
print << "E-O-F";
Usage: rm [-fiPrR] file ...
The options are as follows:
-f Attempt to remove the files without prompting for confirmation, re-
gardless of the file's permissions. If the file does not exist, do
not display a diagnostic message or modify the exit status to re-
flect an error. The -f option overrides any previous -i options.
-i Request confirmation before attempting to remove each file, regard-
share/ppt/rm.pl view on Meta::CPAN
ten three times, first with the byte pattern 0xff, then 0x00, and
then 0xff again, before they are deleted.
-R Attempt to remove the file hierarchy rooted in each file argument.
The -R option implies the -d option. If the -i option is speci-
fied, the user is prompted for confirmation before each directory's
contents are processed (as well as before the attempt is made to
remove the directory). If the user does not respond affirmatively,
the file hierarchy rooted in that directory is skipped.
The rm utility removes symbolic links, not the files referenced by the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/RemoteCommand.pm view on Meta::CPAN
use experimental qw(lexical_subs signatures);
use App::RemoteCommand::Pool;
use App::RemoteCommand::SSH;
use App::RemoteCommand::Select;
use App::RemoteCommand::Util qw(prompt DEBUG logger);
use File::Basename ();
use File::Copy ();
use File::Temp ();
use Getopt::Long ();
lib/App/RemoteCommand.pm view on Meta::CPAN
append_hostname => $append_hostname,
append_time => $append_time,
);
if ($ask_sudo_password) {
my $password = prompt $SUDO_PROMPT;
$self->{sudo_password} = $password;
}
$self->{host} = $host_file ? $self->parse_host_file($host_file)
: $self->parse_host_arg($host_arg);
$self;
view all matches for this distribution