[daisy] daisy backuptool arguments

Elvis Willems ew at schaubroeck.be
Mon Oct 29 08:00:43 CST 2007


Hi,

I wanted to use the daisy repository backup tool today, and noticed that 
it does not give the appropriate error message when one of the arguments 
"-r", "-b" or "-l" is missing.
Instead you will get the not so elegant message:

/java.lang.NullPointerException
        at java.io.File.<init>(File.java:222)
        at org.outerj.daisy.backupTool.BackupTool.main(BackupTool.java:69)/

A quick source code check revealed why...
At lines 64 and 65 of 
"/applications/backuptool/src/java/org/outerj/daisy/backupTool/BackupTool.java/" 
you will find :

/} else if (!cmd.hasOption('l') && !(cmd.hasOption('b') || 
cmd.hasOption('r'))) {
System.out.println("The -l and -b or -r options are required.");
/
However, the tool needs to have the arguments 'l' and 'b' or 'r'.
In this case, the correct syntax would be:

/} else if (!cmd.hasOption('l') || !(cmd.hasOption('b') && 
cmd.hasOption('r'))) {
System.out.println("The -l and -b or -r options are required.");
/
Also, maybe the information concerning the usage of this tool could be 
more clear about this...

-- 
Regards,

Elvis Willems

Schaubroeck Weddecentrale Informatica
Schaubroeck nv, Steenweg Deinze 154, 9810 Nazareth
Tel: 09/389.05.89 Email: ew at schaubroeck.be

 **** DISCLAIMER ****
 http://www.schaubroeck.be/maildisclaimer.htm


More information about the daisy mailing list