Menu

#23 Quotes from the commandline are not parsed correctly

open
nobody
None
5
2011-07-15
2011-07-15
TomK
No

When starting WinRun4j like this:

WinRun4j.exe -myswitch="hello"

the trailing double quote will be removed from the command line arguments and will not be available to the Java main() method. So the following line in the main() method:

System.out.println("arg0=" + args[0]);

Will print -myswitch="hello (without the quote).

The trailing double quotes are removed for every parameter, not only the last one. With the following command line:

winrun4j -myswitch="hello" -switch2="world"

arg[0] will contain "hello
arg[1] will contain "world

Discussion

  • Peter Smith

    Peter Smith - 2011-07-17

    Hi,
    Thanks for the bug report. I'll take a look and try to get a new version out as soon as possible.
    Cheers,
    Peter

     
  • Peter Smith

    Peter Smith - 2011-07-24

    Actually, I'm not overly convinced by this usage.
    I would expect the command line in this case to be entered as:

    winrun4j "-myswitch=hello" "-switch2=world"