Menu

#4 Arguments with Spaces

open-works-for-me
nobody
None
5
2010-12-10
2010-12-10
No

Thank you for porting this to C#. I was excited to find it.

Unless I am doing something wrong there is a major problem though. All of our tools use the unix syntax for command line arguments:
--input FileA.png --output FileB.png

The Parse function works on each element of the string[] args parameter passed to C#'s main function individually. C# splits the argument string by spaces to build the array. As a result when the parser runs it correctly locates the -input parameter, but it cannot locate the value of the parameter because the parameter is actually in the next element of the array.

A workaround is to use --input=FileA.png --output==FileB.png instead.

The space syntax should be supported.

Discussion

  • James Anderson

    James Anderson - 2010-12-10
    • status: open --> open-works-for-me
     
  • James Anderson

    James Anderson - 2010-12-10

    Argh... OK, now it works. Stepping through the code I can see it parses the later arguments. I think what happened is I was using the single dash for arguments with the long argument name.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.