summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/iexec/iexec.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-11 03:01:16 +0000
committerNorbert Preining <norbert@preining.info>2022-10-11 03:01:16 +0000
commit2713ec666b0e53418a839b97c48e0a9234fe5c98 (patch)
tree44f44c40d7cf3d6c2c0be9da7bfcf4dad97eb483 /macros/latex/contrib/iexec/iexec.dtx
parent9c7942efff8183c8695ec824008847dd068dbfe7 (diff)
CTAN sync 202210110301
Diffstat (limited to 'macros/latex/contrib/iexec/iexec.dtx')
-rw-r--r--macros/latex/contrib/iexec/iexec.dtx36
1 files changed, 29 insertions, 7 deletions
diff --git a/macros/latex/contrib/iexec/iexec.dtx b/macros/latex/contrib/iexec/iexec.dtx
index 2478ac224a..28c2a62136 100644
--- a/macros/latex/contrib/iexec/iexec.dtx
+++ b/macros/latex/contrib/iexec/iexec.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{iexec}
%<*package>
-[09.10.20220 0.7.0 Inputable Shell Executions]
+[2022-10-10 0.8.1 Inputable Shell Executions]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -210,7 +210,23 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\usepackage{iexec}
\begin{document}
\iexec[log]{echo 'Hello, \\LaTeX!'}
-\input{foo.txt}
+\end{document}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% \end{macro}
+
+% \begin{macro}{null}
+% The stdout of the command will be sent to |/dev/null|:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\documentclass{article}
+\usepackage{iexec}
+\begin{document}
+\iexec[null]{rm some-file.txt}
\end{document}
\end{verbatim}
%\iffalse
@@ -226,6 +242,8 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
% \changes{v0.4.0}{2021/08/01}{Runtime verification for --shell-escape option}
% \changes{v0.4.1}{2021/08/08}{Options trace, stdout, and quiet added}
% \changes{v0.5.0}{2022/01/08}{Major bug fixes}
+% \changes{v0.6.0}{2022/10/09}{Additional options 'log' and 'append'}
+% \changes{v0.7.0}{2022/10/10}{Additional option 'null'}
% First, we include a few packages:
% \begin{macrocode}
@@ -248,6 +266,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
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,
stdout
}\makeatother
@@ -300,23 +319,25 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
% \end{macrocode}
% Then, we execute it:
% \begin{macrocode}
- \ShellEscape{#2 \ifdefined\iexec@append>\fi> \iexec@stdout}%
+ \ShellEscape{#2 \ifdefined\iexec@append>\fi>\ifdefined\iexec@null/dev/null\else\iexec@stdout\fi}%
% \end{macrocode}
% Then, a message is printed to TeX log:
% \begin{macrocode}
- \message{^^Jiexec: [#2 > \iexec@stdout]^^J}%
+ \message{^^Jiexec: [#2 \ifdefined\iexec@append>\fi>\ifdefined\iexec@null/dev/null\else\iexec@stdout\fi]^^J}%
\endgroup%
% \end{macrocode}
% Then, if required, the content of the stdout file will be printed to the log:
% \begin{macrocode}
+ \ifdefined\iexec@null\else
\ifdefined\iexec@log
\message{^^Jiexec: this is the content of \iexec@stdout:^^J}%
\iexec@typeout{\iexec@stdout}
\message{^^J<EOF>^^J}%
- \fi%
+ \fi\fi%
% \end{macrocode}
% Then, include the produced output into the current document:
% \begin{macrocode}
+ \ifdefined\iexec@null\else
\ifdefined\iexec@quiet
\message{^^Jiexec: Due to 'quiet' option we didn't read
the content of '\iexec@stdout' (\pdffilesize{} bytes)^^J}%
@@ -326,10 +347,11 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\input{\iexec@stdout}%
\message{^^Jiexec: The content of '\iexec@stdout'
was included into the document^^J}%
- \fi%
+ \fi\fi%
% \end{macrocode}
% Finally, delete the file or leave it untouched:
% \begin{macrocode}
+ \ifdefined\iexec@null\else
\ifiexec@trace%
\message{^^Jiexec: Due to package option 'trace',
the file '\iexec@stdout' was not deleted^^J}%
@@ -341,7 +363,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\ShellEscape{rm \iexec@stdout}%
\message{^^Jiexec: The file '\iexec@stdout' was deleted^^J}%
\fi%
- \fi%
+ \fi\fi%
\endgroup
}\makeatother
% \end{macrocode}