Wednesday, 19 January 2011

Checking command-line arguments...

A problem people have been reporting for a while is that xia2 does not fail loudly when you tell it nonsense. Well, I have now added something which does:

gw56@ws050 nonsense]$ xia2 -3d -nonsense /data/gw56/dl/Cowan/Insulin/insulin/
Traceback (most recent call last):
  File "/home/gw56/svn/xia2/Applications/xia2.py", line 45, in 
    from xia2setup import write_xinfo
  File "/home/gw56/svn/xia2/Applications/xia2setup.py", line 35, in 
    from Handlers.CommandLine import CommandLine
  File "/home/gw56/svn/xia2/Handlers/CommandLine.py", line 1513, in 
    CommandLine.setup()
  File "/home/gw56/svn/xia2/Handlers/CommandLine.py", line 349, in setup
    raise RuntimeError, nonsense
RuntimeError: Unknown command-line options: -nonsense

however this will only spot nonsense beginning with '-' as the directory stuff is handled elsewhere. Will be included in next release. Note to self: should really move this to a proper option parser.

No comments: