<div dir="ltr">Hi,<div><br></div><div>A user reported that Swift was not recognizing single quotes within the text of a commandline arg. I was able to reproduce the issue:</div><div><br></div><div>Swift source (printargs.swift) :</div>
<div><br></div><div><div>string anarg=@arg("filter_cmd");</div><div>trace(anarg);</div></div><div><br></div><div>$ swift printargs.swift -filter_cmd="'hello' world"</div><div>Progress: time: Mon, 10 Feb 2014 12:47:41 -0600<br>
</div><div>SwiftScript trace: hello world</div><div><br></div><div>Escape chars do not work:</div><div><br></div>
<div><div>$ swift printargs.swift -filter_cmd=" \'hello\' world"</div><div>/Users/ketan/swift-0.94/cog/modules/swift/dist/swift-svn/bin/swift: eval: line 177: unexpected EOF while looking for matching `''</div>
<div>/Users/ketan/swift-0.94/cog/modules/swift/dist/swift-svn/bin/swift: eval: line 178: syntax error: unexpected end of file</div></div><div><br></div><div>Single quotes in the outer string do not work:</div><div><br></div>
<div><div>$ swift printargs.swift -filter_cmd=' 'hello' world'</div><div>Progress: time: Mon, 10 Feb 2014 12:49:59 -0600<br></div><div>SwiftScript trace: hello world</div></div><div><br></div><div>Outer single quotes and inner double quotes seem to be working:</div>
<div><br></div><div><div>$ swift printargs.swift -filter_cmd=' "hello" world'</div><div>Progress: time: Mon, 10 Feb 2014 12:51:40 -0600<br></div><div>SwiftScript trace: "hello" world</div></div>
<div><br></div><div>A single single quote does not work:</div><div><div>swift printargs.swift -filter_cmd=" he'llo world"</div><div>/Users/ketan/swift-0.94/cog/modules/swift/dist/swift-svn/bin/swift: eval: line 177: unexpected EOF while looking for matching `''</div>
<div>/Users/ketan/swift-0.94/cog/modules/swift/dist/swift-svn/bin/swift: eval: line 178: syntax error: unexpected end of file</div></div><div><br></div><div><br></div><div>In summary, it seems impossible to pass single quote character (') to Swift commandline arg values.</div>
<div><br></div><div>Thanks,</div><div>Ketan</div></div>