From 8b451263c704aa050c23c14af8e204f560fe4be5 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 15 Apr 2017 00:13:58 +0000 Subject: start on tlmgr shell git-svn-id: svn://tug.org/texlive/trunk@43795 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 34 +++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'Master/texmf-dist/scripts') diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 1117e5e94e1..9e0d5601525 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -389,6 +389,11 @@ sub main { TeXLive::TLUtils::process_logging_options(); + my $shellcheck = $ARGV[0]; + if (defined($shellcheck) && $shellcheck eq "shell") { + exit(start_shell()); + } + GetOptions(\%opts, keys(%optarg)) or pod2usage(2); $::debug_translation = 0; @@ -6495,7 +6500,34 @@ sub check_on_writable { } return 1; } - + + +########### +# tlmgr shell code +sub start_shell { + my $protocol = 1; + my $prompt = "tlmgr> "; + + print "protocol $protocol\n"; + while (1) { + print $prompt; + my $ans = ; + chomp $ans; + my ($cmd, @args) = split(' ', $ans); + next if (!$cmd); + if ($cmd eq "protocol") { + print "protocol $protocol\n"; + } elsif ($cmd eq "version") { + print give_version(), "\n"; + } elsif ($cmd =~ m/^(quit|end|byebye)$/i) { + return 0; + } else { + print "not implemented by now\n"; + } + } +} + + 1; __END__ -- cgit v1.2.3