diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-15 20:16:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-15 20:16:35 +0000 |
commit | 4937b55f5e2286de6075bc02f931d74ab0ab5f74 (patch) | |
tree | a7132f743f77d8606060684b0608e0e6453bb9f0 | |
parent | 01d5c331eabd2c51803456840e02114d27323fd0 (diff) |
iexec (15oct22)
git-svn-id: svn://tug.org/texlive/trunk@64707 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/iexec/iexec.pdf | bin | 293663 -> 293865 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/iexec/iexec.dtx | 61 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/iexec/iexec.sty | 31 |
3 files changed, 47 insertions, 45 deletions
diff --git a/Master/texmf-dist/doc/latex/iexec/iexec.pdf b/Master/texmf-dist/doc/latex/iexec/iexec.pdf Binary files differindex 9bab38749a4..3b14fd32d0b 100644 --- a/Master/texmf-dist/doc/latex/iexec/iexec.pdf +++ b/Master/texmf-dist/doc/latex/iexec/iexec.pdf diff --git a/Master/texmf-dist/source/latex/iexec/iexec.dtx b/Master/texmf-dist/source/latex/iexec/iexec.dtx index 82182ba0850..ff627551a57 100644 --- a/Master/texmf-dist/source/latex/iexec/iexec.dtx +++ b/Master/texmf-dist/source/latex/iexec/iexec.dtx @@ -50,7 +50,7 @@ %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{iexec} %<*package> -[2022-10-12 0.9.0 Inputable Shell Executions] +[2022-10-15 0.9.1 Inputable Shell Executions] %</package> %<*driver> \documentclass{ltxdoc} @@ -105,8 +105,7 @@ Today is % Today is \iexec[log]{date +\%e-\%b-\%Y} % \end{multicols} -% \DescribeMacro{\iexec} -% The only command provided by this package is |\iexec| \oarg{options} \marg{cmd}. +% \DescribeMacro{\iexec} The only command provided by this package is |\iexec| \oarg{options} \marg{cmd}. % Its only mandatory argument \meta{cmd} is the command to be executed % through the terminal shell (bash, or whatever is set as the default one % on your user console). @@ -118,8 +117,7 @@ Today is % \section{Options} -% \DescribeMacro{quiet} -% If you don't want the output to be visible, +% \DescribeMacro{quiet} If you don't want the output to be visible, % use |\phantom\{\iexec{...}}|. % Otherwise, you can use |quiet| option: %\iffalse @@ -139,8 +137,7 @@ I just want to delete some file: % In this case, whatever the shell command produces will not be included % into the document. -% \DescribeMacro{stdout} -% The output of your code is saved into the file provided as an +% \DescribeMacro{stdout} The output of your code is saved into the file provided as an % optional argument of |\iexec| (the default value is |iexec.tmp|): %\iffalse %<*verb> @@ -157,8 +154,7 @@ Today is \iexec[stdout=date.txt]{date +\%e-\%b-\%Y | tr -d '\\n'}. %\fi % The tailing part of the command here removes all ends-of-line. -% \DescribeMacro{stderr} -% The error output of the code is saved into the file provided as an +% \DescribeMacro{stderr} The error output of the code is saved into the file provided as an % optional argument of |\iexec| (by default the error output % is streamed into |stdout|): %\iffalse @@ -175,8 +171,7 @@ Today is \iexec[stderr=my.txt]{broken-command}. %</verb> %\fi -% \DescribeMacro{trace} -% The file specified will be deleted right after its usage. If you don't +% \DescribeMacro{trace} The file specified will be deleted right after its usage. If you don't % want this to happen, use |trace| package option: all files will remain % in the directory where they were created. % It's possible to turn tracing on globbaly, for the entire document, using @@ -195,8 +190,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}. %</verb> %\fi -% \DescribeMacro{append} -% The stdout produced will be appended to the file specified: +% \DescribeMacro{append} The stdout produced will be appended to the file specified: %\iffalse %<*verb> %\fi @@ -213,8 +207,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}. %</verb> %\fi -% \DescribeMacro{log} -% The stdout produced will be printed in \TeX{} log: +% \DescribeMacro{log} The stdout produced will be printed in \TeX{} log: %\iffalse %<*verb> %\fi @@ -229,8 +222,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}. %</verb> %\fi -% \DescribeMacro{null} -% The stdout of the command will be sent to |/dev/null|: +% \DescribeMacro{null} The stdout of the command will be sent to |/dev/null|: %\iffalse %<*verb> %\fi @@ -258,30 +250,36 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}. % \changes{v0.8.0}{2022/10/11}{Bug fixes} % \changes{v0.9.0}{2022/10/12}{Additional option 'stderr'} -% First, we include a few packages: +% First, we include \href{https://ctan.org/pkg/shellesc}{shellesc} package, which +% we use to execute shell commands: % \begin{macrocode} \RequirePackage{shellesc} -\RequirePackage{pgfkeys} -\RequirePackage{expl3} % \end{macrocode} % Then, we parse package options: % \begin{macrocode} \RequirePackage{xkeyval} -\makeatletter\newif\ifiexec@trace +\makeatletter +\newif\ifiexec@trace \DeclareOptionX{trace}{\iexec@tracetrue} -\ProcessOptionsX\relax\makeatother +\ProcessOptionsX\relax +\makeatother +% \end{macrocode} + +% Then, we prepare to parse the options of |\iexec| command: +% \begin{macrocode} +\RequirePackage{pgfkeys} \makeatletter\pgfkeys{ /iexec/.is family, /iexec, - stdout/.estore in = \iexec@stdout, + stdout/.store in = \iexec@stdout, stdout/.default = iexec.tmp, - stderr/.estore in = \iexec@stderr, - trace/.estore in = \iexec@traceit, - append/.estore in = \iexec@append, - log/.estore in = \iexec@log, - null/.estore in = \iexec@null, - quiet/.estore in = \iexec@quiet, + stderr/.store in = \iexec@stderr, + trace/.store in = \iexec@traceit, + append/.store in = \iexec@append, + log/.store in = \iexec@log, + null/.store in = \iexec@null, + quiet/.store in = \iexec@quiet, stdout }\makeatother % \end{macrocode} @@ -290,6 +288,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}. % Then, we define an internal command |\iexec@typeout| for printing the content of a file, % as suggested \href{https://tex.stackexchange.com/questions/660808}{here}: % \begin{macrocode} +\RequirePackage{expl3} \makeatletter\ExplSyntaxOn \NewDocumentCommand{\iexec@typeout}{m}{ \iexec_typeout_file:n { #1 }} @@ -316,10 +315,10 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}. % First, we verify that |latex| is running with |--shell-escape| option, since without % it nothing will work; so, it's better to throw an error earlier than later: % \begin{macrocode} - \ifdefined\pdfshellescape\ifnum\pdfshellescape=1\else% + \ifnum\ShellEscapeStatus=1\else% \PackageError{iexec}{You must run TeX processor with --shell-escape option}{}% - \fi\fi% + \fi% \begingroup% % \end{macrocode} % Then, start the log from a clean line: diff --git a/Master/texmf-dist/tex/latex/iexec/iexec.sty b/Master/texmf-dist/tex/latex/iexec/iexec.sty index 3aea422ecc0..4eca7db498a 100644 --- a/Master/texmf-dist/tex/latex/iexec/iexec.sty +++ b/Master/texmf-dist/tex/latex/iexec/iexec.sty @@ -31,7 +31,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{iexec} -[2022-10-12 0.9.0 Inputable Shell Executions] +[2022-10-15 0.9.1 Inputable Shell Executions] @@ -48,27 +48,30 @@ \RequirePackage{shellesc} -\RequirePackage{pgfkeys} -\RequirePackage{expl3} \RequirePackage{xkeyval} -\makeatletter\newif\ifiexec@trace +\makeatletter +\newif\ifiexec@trace \DeclareOptionX{trace}{\iexec@tracetrue} -\ProcessOptionsX\relax\makeatother +\ProcessOptionsX\relax +\makeatother + +\RequirePackage{pgfkeys} \makeatletter\pgfkeys{ /iexec/.is family, /iexec, - stdout/.estore in = \iexec@stdout, + stdout/.store in = \iexec@stdout, stdout/.default = iexec.tmp, - stderr/.estore in = \iexec@stderr, - trace/.estore in = \iexec@traceit, - append/.estore in = \iexec@append, - log/.estore in = \iexec@log, - null/.estore in = \iexec@null, - quiet/.estore in = \iexec@quiet, + stderr/.store in = \iexec@stderr, + trace/.store in = \iexec@traceit, + append/.store in = \iexec@append, + log/.store in = \iexec@log, + null/.store in = \iexec@null, + quiet/.store in = \iexec@quiet, stdout }\makeatother +\RequirePackage{expl3} \makeatletter\ExplSyntaxOn \NewDocumentCommand{\iexec@typeout}{m}{ \iexec_typeout_file:n { #1 }} @@ -85,10 +88,10 @@ \makeatletter\newcommand\iexec[2][]{% \begingroup \pgfqkeys{/iexec}{#1}% - \ifdefined\pdfshellescape\ifnum\pdfshellescape=1\else% + \ifnum\ShellEscapeStatus=1\else% \PackageError{iexec}{You must run TeX processor with --shell-escape option}{}% - \fi\fi% + \fi% \begingroup% \message{^^J}% \let\%\@percentchar% |