summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/CPAN/Prompt.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPAN/Prompt.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/CPAN/Prompt.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPAN/Prompt.pm b/Master/tlpkg/tlperl/lib/CPAN/Prompt.pm
new file mode 100644
index 00000000000..7a4e2d81e13
--- /dev/null
+++ b/Master/tlpkg/tlperl/lib/CPAN/Prompt.pm
@@ -0,0 +1,29 @@
+# -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-
+# vim: ts=4 sts=4 sw=4:
+package CPAN::Prompt;
+use overload '""' => "as_string";
+use vars qw($prompt);
+use vars qw(
+ $VERSION
+);
+$VERSION = "5.5";
+
+
+$prompt = "cpan> ";
+$CPAN::CurrentCommandId ||= 0;
+sub new {
+ bless {}, shift;
+}
+sub as_string {
+ my $word = "cpan";
+ unless ($CPAN::META->{LOCK}) {
+ $word = "nolock_cpan";
+ }
+ if ($CPAN::Config->{commandnumber_in_prompt}) {
+ sprintf "$word\[%d]> ", $CPAN::CurrentCommandId;
+ } else {
+ "$word> ";
+ }
+}
+
+1;