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 ++++++++++++++++++++- Master/tlpkg/doc/tlmgr-shell.txt | 48 ++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 Master/tlpkg/doc/tlmgr-shell.txt 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__ diff --git a/Master/tlpkg/doc/tlmgr-shell.txt b/Master/tlpkg/doc/tlmgr-shell.txt new file mode 100644 index 00000000000..93384a53f4a --- /dev/null +++ b/Master/tlpkg/doc/tlmgr-shell.txt @@ -0,0 +1,48 @@ +TeX Live Manager Shell +====================== + +to be written + +after starting, tlmgr shell echos out the protocol version + $ tlmgr shell + protocol NNN +where NNN is a natural number, increasing when some commands +are added, changed. + +Question: +Handling of settings: e.g., how to mimic --repository and how +to distinguish it from settings to be saved into the tlpdb. +(--repository is used only for one incantation, but not saved +into tlpdb) + +Commands: +--------- +* set + sets some variables not to be saved into the tlpdb + set repository ... == --repository + set gui-lang LL == --gui-lang + set debug-translation 1 == --debug-translations + set machine-readable 1 == --machine-readable + set no-execute-actions 1 == --no-execute-actions + set package-logfile .. == --package-logfile + set persistent-downloads 0|1 == --(no-)persistent-downloads + set pin-file ... == --pin-file + set require-verification 0|1 == --(no-)require-verification + set usermode 1 == --usermode + set verify-downloads 0|1 == --(no-)verify-downloads + +* quit|end|byebye + ends the session + +* load local|remote + loads the local or remote database + the remote tlpdb is determined by either the setting in the + loaded local tlpdb, or by the "repository" setting (see above) + +* save + saves the local tlpdb (this is also done by several actions) + +All other actions are converted to commands and behave in the +absolut same way. + + -- cgit v1.2.3