Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Tutoren/syntax/xle-docker
1 result
Show changes
Commits on Source (4)
......@@ -33,6 +33,8 @@ sudo docker run \
This will take a few seconds. The parses will then be output to the command line using XLE's own XML export format. If you want to store the output in a file, append `> name_of_your_file.xml` at the end of the command.
If no parses are generated, the container will exit with exit code `42` and write the XLE shell output to stderr.
<details>
<summary>Advanced information</summary>
......@@ -89,7 +91,9 @@ It then executes `xle` using the `xvfb-run` wrapper (which ensures `xle` can acc
:books: [Ubuntu Manpage: xvfb-run - run specified X client or command in a virtual X server environment][xvfb-run]
As a final step, `cat` is used to output the export file to the standard output.
As a final step, `cat` is used to output the export file to the standard output or to output the XLE log to standard error.
:books: [Answer to "echo that outputs to stderr" by Brandon Rhodes on Stack Overflow][stderr-so]
[xle]:https://ling.sprachwiss.uni-konstanz.de/pages/xle/
[xvfb]:https://blog.kagesenshi.org/2007/06/running-x-applications-headless-using.html
......@@ -99,3 +103,4 @@ As a final step, `cat` is used to output the export file to the standard output.
[3rd-repo-lu]:https://www.linuxuprising.com/2021/01/apt-key-is-deprecated-how-to-add.html
[narnold-xle]:https://www.cl.uni-heidelberg.de/~narnold/xle/posts/2021-05-25-syntax-xle-mad.html
[xvfb-run]:https://manpages.ubuntu.com/manpages/trusty/man1/xvfb-run.1.html
[stderr-so]:https://stackoverflow.com/a/11422223/
......@@ -21,7 +21,17 @@ echo "packed-xml-fs { $SENTENCE } packed-parses.xml" >> xlerc
echo "exit" >> xlerc
# Start XLE (under the X server), this will automatically load xlerc, let it complete the parse and end
xvfb-run xle > /dev/null 2> /dev/null
# Save the messages of xle to xle_messages.txt
xvfb-run xle > xle_messages.txt 2> /dev/null
# Print parse file to stdout
cat packed-parses.xml
if [[ -f packed-parses.xml ]]
then
# Print parse file to stdout and exit with success
cat packed-parses.xml
exit 0
else
# Print xle output to stderr and fail
cat xle_messages.txt >&2
exit 42
fi