Help save net neutrality! Learn more.
Close

#412 have teitoX tools fail when extra arguments are passed

closed-accepted
5
2012-12-14
2012-12-14
No

A bug in a Makefile of mine caused make to issue the following command:

$ teitodocx schemas.xml test1.xml test2.xml *.docx

And teitodocx duly converted schemas.xml (which is not a TEI file but a schema location file for Emacs) into a docx file which it stored in test1.xml. Fair enough. (Although if there were an easy way to make teitodocx fail if the input file is not some sort of TEI document, that would be neat.)

However, it accepted the extra arguments test2.xml and *.docx (there being no docx file in the directory, glob failed and the shell left this argument unchanged) but ignored them silently. Since there are no defined semantics to passing more than one source file and destination file to teitodocx and its siblings, it would be helpful if they failed before doing any processing when extra arguments are passed.

Discussion

  • Sebastian Rahtz

    Sebastian Rahtz - 2012-12-14

    Fair request, duly done:

    rahtz:Stylesheets rahtz$ ./teitohtml style.xml x.html 1 2 3
    Error: only two parameters (input file and output file ) allowed: style.xml x.html 1 2 3

     
  • Sebastian Rahtz

    Sebastian Rahtz - 2012-12-14
    • status: open --> closed-accepted