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
bin/reslirp-tunnel view on Meta::CPAN
options and manages IP routing rules along with DNS resolution
configuration, greatly simplifying the setup process for a reSLIRP
tunnel.
The program is designed to be executed by a non-root user. It
automatically invokes sudo in the background, which typically prompts
the user for a password to perform privileged operations.
=head1 OPTIONS
=over 8
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/RouterColorizer.pm view on Meta::CPAN
"\e[30m\e[45m", # black on magenta
"\e[30m\e[46m", # black on cyan
);
sub format_text ( $self, $text ) {
# Remove Arista "more" prompt
$text =~ s/ \x1b \[ \Q3m --More-- \E \x1b \[ 23m \x1b \[ K \r \x1b \[ K //gmsxx;
# Break into lines
my $output = '';
while ( $text =~ m/([^\n\r]*[\r]?[\n]?)/g ) {
lib/App/RouterColorizer.pm view on Meta::CPAN
my $preamble = '';
if ( $line =~ s/^ ( .* (?<! \x1b \[23m) \x1b (?: \[K | M)) //sxx ) {
$preamble = $1;
}
# Arista "More" prompt (should this be in the Arista parse-line?)
$line =~ s/ ^ ( \x1b \[ \Q3m --More-- \E .* \x0d \x1b \[K )//sxx;
# A space that is backspaced over
$line =~ s/ \Q \E \x08 //gxx;
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/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
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/SeismicUnixGui/big_streams/iBottomMute.pl view on Meta::CPAN
#use aliased 'App::SeismicUnixGui::misc::readfiles';
use Tk;
use App::SeismicUnixGui::misc::SeismicUnix qw($true $false );
use aliased 'App::SeismicUnixGui::sunix::shell::xk';
my $iBM_Tk = {_prompt => ''};
=head2 Instantiate classes:
Create a new version of the package
lib/App/SeismicUnixGui/big_streams/iBottomMute.pl view on Meta::CPAN
MainLoop; # for Tk widgets
} # for new data
=head2 Set the prompt
value according
to which button is pressed
then exit the MainLoop
destroy the main window after the prompt
is properly set
=cut
=head2 sub set_pick
lib/App/SeismicUnixGui/big_streams/iBottomMute.pl view on Meta::CPAN
=cut
sub set_pick {
my $pick = 'pick';
$pick_rb->configure( -state => 'normal' );
$iBM_Tk->{_prompt} = $pick;
print("Picking...\n");
$iBM->gather_num($gather);
lib/App/SeismicUnixGui/big_streams/iBottomMute.pl view on Meta::CPAN
=cut
sub set_calc {
my $calc = 'calc';
$calc_rb->configure( -state => 'normal' );
$iBM_Tk->{_prompt} = $calc;
print("Calculating...\n");
=head2 Delete
the previous display
lib/App/SeismicUnixGui/big_streams/iBottomMute.pl view on Meta::CPAN
=cut
sub set_saveNcont {
my $saveNcont = 'saveNcont';
$saveNcont_rb->configure( -state => 'normal' );
$iBM_Tk->{_prompt} = $saveNcont;
print("Saving and Continuing...\n");
#$iBM->icp_sorted2oldpicks();
&set_next();
lib/App/SeismicUnixGui/big_streams/iBottomMute.pl view on Meta::CPAN
=head2 sub set_next
In this case the $variable is empty
1. increment gather
Exit if beyond last gather
2. reset prompt
3. Otherwise display the first semblance
4 ... see following callbacks
=cut
sub set_next {
print("Next...\n");
$next_rb->configure( -state => 'normal' );
my $next = '';
$iBM_Tk->{_prompt} = $next;
$gather = $gather + $gather_inc;
#print("new gather is $gather \n\n");
=head2 Delete output
lib/App/SeismicUnixGui/big_streams/iBottomMute.pl view on Meta::CPAN
=cut
sub set_exit {
my $exit = 'exit';
$exit_rb->configure( -state => 'normal' );
$iBM_Tk->{_prompt} = $exit;
print("Good bye.\n");
print("Not continuing to next gather\n");
$xk->kill_this('suximage');
$xk->kill_this('suxwigb');
$xk->kill_this('xgraph');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ShellCompleter/cpanm.pm view on Meta::CPAN
'mirror-only!' => $noop,
'mirror-index=s' => $noop,
'M|from=s' => $noop, # url (this is --mirror and --mirror-only combined)
'cpanmetadb=s' => $noop,
'cascade-search!' => $noop,
'prompt!' => $noop,
'installdeps' => $noop,
'skip-installed!' => $noop,
'skip-satisfied!' => $noop,
'reinstall' => $noop,
'interactive!' => $noop,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Shotgun/Target/SFTP.pm view on Meta::CPAN
# tell poco-generic to shutdown
if ( defined $self->sftp ) {
# TODO ARGH poco-generic NEEDS TO SHUTDOWN NOW
# the problem is that it does a "graceful" shutdown
# but the ssh process is stuck on password prompt
# and everything freezes....
$self->sftp->{'wheel'}->kill( 'KILL' );
$poe_kernel->call( $self->sftp->session_id, 'shutdown' );
$self->sftp( undef );
}
lib/App/Shotgun/Target/SFTP.pm view on Meta::CPAN
Implements the SFTP ( FTP via SSH ) target.
Note: It is recommended to have ssh certificates set up for passwordless authentication. If you supply a password, L<Net::SFTP::Foreign>
will attempt to use L<Expect> to do the interaction, but you must have L<Expect> installed. Otherwise the connection will hang at the
password prompt and nothing will work!
=head1 ATTRIBUTES
=head2 port
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Siesh.pm view on Meta::CPAN
}
my $term = new Term::ShellUI(
%shellui_params,
history_file => '~/.siesh_history',
prompt => 'siesh> ',
commands => {
"help" => {
desc => "Print this help page.",
args => sub { shift->help_args( undef, @_ ); },
method => sub { shift->help_call( undef, @_ ); },
lib/App/Siesh.pm view on Meta::CPAN
("auto") or disables ("off"). Defaults to I<auto>.
=item file
If an IO::Handle object is provdided, App::Siesh won't read commands
from the command line prompt, but from that filehandle.
=item password
Specifies the password to login.
lib/App/Siesh.pm view on Meta::CPAN
disk first. Under the hood it creates a temporary file, puts the script
content in it and calls C<$ENV{EDITOR}> on it. After that the script is
uploaded back. It's also possible to create and edit a new script with
this command.
If your script is syntactical incorrect, you will be prompted to
re-edit the file or throw away your changes.
Synonyms: B<vi>
=item B<copy> I<script-name> I<script-name>
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/Module/Build.pm view on Meta::CPAN
=item installdeps
[version 0.36]
This action will use the C<cpan_client> parameter as a command to install
missing prerequisites. You will be prompted whether to install
optional dependencies.
The C<cpan_client> option defaults to 'cpan' but can be set as an option or in
F<.modulebuildrc>. It must be a shell command that takes a list of modules to
install as arguments (e.g. 'cpanp -i' for CPANPLUS). If the program part is a
view all matches for this distribution
view release on metacpan or search on metacpan
share/public/highlight/highlight.min.js view on Meta::CPAN
keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,l],
illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{
begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",
end:"\\][a-z]*"}]}].concat(r,b),relevance:0}].concat(r,b)
;l.contains=u,_.contains=u;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:u}
},{className:"meta.prompt",
begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",
starts:{end:"$",keywords:t,contains:u}}];return b.unshift(r),{name:"Ruby",
aliases:["rb","gemspec","podspec","thor","irb"],keywords:t,illegal:/\/\*/,
contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(b).concat(u)}}})()
;hljs.registerLanguage("ruby",e)})();/*! `graphql` grammar compiled for Highlight.js 11.7.0 */
share/public/highlight/highlight.min.js view on Meta::CPAN
match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],
scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{
className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,b]}]}}})()
;hljs.registerLanguage("python",e)})();/*! `python-repl` grammar compiled for Highlight.js 11.7.0 */
(()=>{var a=(()=>{"use strict";return a=>({aliases:["pycon"],contains:[{
className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}
},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]})})()
;hljs.registerLanguage("python-repl",a)})();/*! `lua` grammar compiled for Highlight.js 11.7.0 */
(()=>{var e=(()=>{"use strict";return e=>{const t="\\[=*\\[",a="\\]=*\\]",n={
begin:t,end:a,contains:["self"]
},o=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",a,{contains:[n],
share/public/highlight/highlight.min.js view on Meta::CPAN
begin:"\\(",endsWithParent:!0,contains:o}].concat(o)
},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",
begin:t,end:a,contains:[n],relevance:5}])}}})();hljs.registerLanguage("lua",e)
})();/*! `shell` grammar compiled for Highlight.js 11.7.0 */
(()=>{var s=(()=>{"use strict";return s=>({name:"Shell Session",
aliases:["console","shellsession"],contains:[{className:"meta.prompt",
begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,
subLanguage:"bash"}}]})})();hljs.registerLanguage("shell",s)})();/*! `wasm` grammar compiled for Highlight.js 11.7.0 */
(()=>{var e=(()=>{"use strict";return e=>{e.regex;const a=e.COMMENT(/\(;/,/;\)/)
;return a.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,
keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Smbxfer.pm view on Meta::CPAN
close $credentials;
($username, $password, $domain) = @lines;
}
else {
# Getting credentials interactively...
$username = prompt( "username? " );
$password = prompt( "password? ", -e => '*' );
$domain = prompt( "domain? " );
}
return $username, $password, $domain;
}
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, always use defaults
if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
sub makemaker_args {
my $self = shift;
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, always use defaults
if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
sub makemaker_args {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/SpreadRevolutionaryDate/Config.pm view on Meta::CPAN
'liberachat_nickname' => {ARGCOUNT => ARGCOUNT_ONE, ALIAS => 'ln'},
'liberachat_password' => {ARGCOUNT => ARGCOUNT_ONE, ALIAS => 'lp'},
'liberachat_test_channels' => {ARGCOUNT => ARGCOUNT_LIST, ALIAS => 'ltc'},
'liberachat_channels' => {ARGCOUNT => ARGCOUNT_LIST, ALIAS => 'lc'},
'revolutionarydate_acab' => {ARGCOUNT => ARGCOUNT_NONE, ALIAS => 'ra'},
'promptuser_default' => {ARGCOUNT => ARGCOUNT_ONE, ALIAS => 'pud'},
'promptuser_img_path' => {ARGCOUNT => ARGCOUNT_ONE, ALIAS => 'pui'},
'promptuser_img_alt' => {ARGCOUNT => ARGCOUNT_ONE, ALIAS => 'pua'},
'promptuser_img_url' => {ARGCOUNT => ARGCOUNT_ONE, ALIAS => 'puu'},
'gemini_api_key' => {ARGCOUNT => ARGCOUNT_ONE, ALIAS => 'ga'},
'gemini_process' => {ARGCOUNT => ARGCOUNT_ONE, ALIAS => 'g'},
'gemini_prompt' => {ARGCOUNT => ARGCOUNT_HASH, ALIAS => 'gp'},
'gemini_intro' => {ARGCOUNT => ARGCOUNT_HASH, ALIAS => 'gi'},
'gemini_search' => {ARGCOUNT => ARGCOUNT_HASH, ALIAS => 'gs'},
'gemini_img_path' => {ARGCOUNT => ARGCOUNT_HASH, ALIAS => 'gip'},
'gemini_img_alt' => {ARGCOUNT => ARGCOUNT_HASH, ALIAS => 'gia'},
'gemini_img_url' => {ARGCOUNT => ARGCOUNT_HASH, ALIAS => 'giu'},
lib/App/SpreadRevolutionaryDate/Config.pm view on Meta::CPAN
$msgmaker_args{acab} = $self->acab
if $msgmaker eq 'revolutionarydate'
&& !$msgmaker_args{acab}
&& $self->acab;
# Do not prompt if PromptUser default is set
if ($msgmaker eq 'promptuser') {
require App::SpreadRevolutionaryDate::MsgMaker::PromptUser;
if ($msgmaker_args{default} && $msgmaker_args{default} ne App::SpreadRevolutionaryDate::MsgMaker::PromptUser->meta->get_attribute('default')->default) {
$ENV{PERL_MM_USE_DEFAULT} = 1
}
}
lib/App/SpreadRevolutionaryDate/Config.pm view on Meta::CPAN
--freenode_nickname|-fn <nick>: define Freenode nickname
--freenode_password|-fp <passwd>: define Freenode password
--freenode_test_channels|-ftc <channel_1> [--freenode_test_channels|-ftc <channel_2> [â¦--freenode_test_channels|-ftc <channel_n>]]: define Freenode channels
--freenode_channels|-fc <channel_1> [--freenode_channels|-fc <channel_2> [â¦--freenode_channels|-fc <channel_n>]]: define Freenode test channels
--revolutionarydate_acab | -ra: pretend it is 01:31:20 (default: false)
--promptuser_default|-pud <msg>: define default message when --msgmaker=PromptUser (default: 'Goodbye old world, hello revolutionary worlds')
--promptuser_img_path|-pui <path/to/image/file>: define image file path when --msgmaker=PromptUser
--promptuser_img_alt|-pua <alternative text>: define image alternative text when --msgmaker=PromptUser
--promptuser_img_url|-puu <https://example.com/imgs/my_image.jgp>: define image external url when --msgmaker=PromptUser
--gemini_api_key|-ga <msg>: define default message when --msgmaker=PromptUser (default: 'Goodbye old world, hello revolutionary worlds')
--gemini_process|-g <SomePrompt>: tell which prompt to process --msgmaker=Gemini
--gemini_prompt|-gp "<SomePrompt>=<my prompt string>": define prompt to request for when --msgmaker=Gemini
--gemini_intro|-gi "<SomePrompt>=<intro msg>": define introduction message to preprend to response when --msgmaker=Gemini
--gemini_search|-gs "<SomePrompt>=1": use grounding search results when --msgmaker=Gemini
--gemini_img_path|-gip "<SomePrompt>=<path/to/image/file>": define image file path when --msgmaker=Gemini
--gemini_img_alt|-gia "<SomePrompt>=<alternative text>": define image alternative text when --msgmaker=Gemini
--gemini_img_url|-giu "<SomePrompt>=<https://example.com/imgs/my_image.jgp>": define image external url when --msgmaker=Gemini
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Sqitch.pm view on Meta::CPAN
my $answer = <STDIN>;
chomp $answer if defined $answer;
return $answer;
}
sub prompt {
my $self = shift;
my $msg = shift or hurl 'prompt() called without a prompt message';
# use a list to distinguish a default of undef() from no default
my @def;
@def = (shift) if @_;
# use dispdef for output
lib/App/Sqitch.pm view on Meta::CPAN
return $ans;
}
sub ask_yes_no {
my ($self, @msg) = (shift, shift);
hurl 'ask_yes_no() called without a prompt message' unless $msg[0];
my $y = __p 'Confirm prompt answer yes', 'Yes';
my $n = __p 'Confirm prompt answer no', 'No';
push @msg => $_[0] ? $y : $n if @_;
my $answer;
my $i = 3;
while ($i--) {
$answer = $self->prompt(@msg);
return 1 if $y =~ /^\Q$answer/i;
return 0 if $n =~ /^\Q$answer/i;
$self->emit(__ 'Please answer "y" or "n".');
}
lib/App/Sqitch.pm view on Meta::CPAN
Send a warning messages to C<STDERR>. Warnings will have C<warning: > prefixed
to every line. Use if something unexpected happened but you can recover from
it. C<warn> appends a newline to the end of the message while C<warn_literal>
does not.
=head3 C<prompt>
my $ans = $sqitch->('Why would you want to do this?', 'because');
Prompts the user for input and returns that input. Pass in an optional default
value for the user to accept or to be used if Sqitch is running unattended. An
exception will be thrown if there is no prompt message or if Sqitch is
unattended and there is no default value.
=head3 C<ask_yes_no>
if ( $sqitch->ask_yes_no('Are you sure?', 1) ) { # do it! }
lib/App/Sqitch.pm view on Meta::CPAN
and negative replies from the user should be localized variants of "yes" and
"no", and will be matched as such. If no translation library is in use, the
answers will default to the English "yes" and "no".
If the user inputs an invalid value three times, an exception will be thrown.
An exception will also be thrown if there is no message. As with C<prompt()>,
an exception will be thrown if Sqitch is running unattended and there is no
default.
=head3 C<ask_y_n>
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
$TestOnly = 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
if (
!$SkipInstall
and (
$CheckOnly
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 defined( _version_check( _load($class), $ver ) ); # 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;
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
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, always use defaults
if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
sub makemaker_args {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Sybil/Command/auth.pm view on Meta::CPAN
use warnings;
use v5.12;
use App::Sybil -command;
use IO::Prompt::Simple 'prompt';
sub abstract { 'Authenticate with github' }
sub execute {
my ($self, $opt, $args) = @_;
lib/App/Sybil/Command/auth.pm view on Meta::CPAN
say STDERR "You already have an authentication token.";
return;
}
# TODO hide password when typing
my $user = prompt('GitHub Username');
my $pass = prompt('GitHub Password');
my $github = Net::GitHub->new(
version => 3,
login => $user,
pass => $pass,
);
eval { $github->user->show(); };
if ($@ =~ /OTP/) {
my $otp = prompt('Authenticator code');
$github = Net::GitHub->new(
version => 3,
login => $user,
pass => $pass,
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Devel/CheckOS.pm view on Meta::CPAN
=head1 AUTHOR
David Cantrell E<lt>F<david@cantrell.org.uk>E<gt>
Thanks to David Golden for the name and ideas about the interface, and
to the cpan-testers-discuss mailing list for prompting me to write it
in the first place.
Thanks to Ken Williams, from whose L<Module::Build> I lifted some of the
information about what should be in the Unix family.
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
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
templates/bash.sh view on Meta::CPAN
[ ! -d "${dirname}" ] && mkdir -p "${dirname}"
[ -d "${dirname}" ]
return $?
}
function input_withprompt { # <promptstr>
typeset promptstr="${1}"
typeset var=""
if [ "${BASH_VERSION}" != "" ]; then
read -p "${promptstr}" var
else
read "var?${promptstr}"
fi
msg "${var}"
}
function tmpnam { # <prefix
view all matches for this distribution