Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bin/texml returns 0 whether it succeeds or fails #226

Open
freddrueck opened this issue Nov 15, 2024 · 3 comments
Open

bin/texml returns 0 whether it succeeds or fails #226

freddrueck opened this issue Nov 15, 2024 · 3 comments

Comments

@freddrueck
Copy link

Instead of providing a non-zero return value when something goes wrong, bin/texml always returns 0, so the obvious way of checking whether texml succeeded/failed in an external script that calls texml isn't possible.

@freddrueck
Copy link
Author

Investigating texml more carefully, I see now that it actually operates on @argv, popping off filenames and trying to compile them to XML. I could imagine for some use cases it's useful to not have the perl script crash and compile all the documents which it is capable of compiling, however, if you are trying to call it externally it's really annoying not have it just crash when given bad input. At the very least, it would be nice to have the usage subroutine properly document this behavior; for the way I would like to use texml, it would be more useful for me to have texml only be capable of processing a single tex file at a time, but properly returning a non-zero value if it fails to compile that tex file.

I can probably implent a very dumb version of this by just adding a few lines of code to check if it created the output XML file and then issueing die; if didn't.

@freddrueck
Copy link
Author

texml_die_if_xml_fails_to_compile_patch.txt

The attached patch implements a very primitive "die if XML didn't compile" for the first file that in @argv that fails to generate an XML output

@freddrueck
Copy link
Author

I have now also submitted a pull request to merge changes that I think will resolve this issue, at least well enough for my intended use-case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant