Port of FS42 - command line parameters are not parsed properly on Unix and unlike 3.6. #145
Labels
bug
reported or triaged as proper bug, i.e. not working as designed, and affecting all platforms
compatibility
reported or triaged as compatibility issue, i.e. affecting only some build or runtime environments
OS: Unix
specific to POV-Ray for Unix
http://bugs.povray.org/task/42
Details
POV-Ray does not follow common practice on command-line handling; for instance:
povray +i"My File"
entered on a Unix shell would be passed to POV-Ray as
(each line representing a distinct parameter here), which POV-Ray would further dissect, interpreting it as
To achieve the desired effect, one would actually have to quote the string twice:
povray +i"'My File'"
which the shell would translate to
which POV-Ray would interpret as
In both cases, this is obviously not what a Unix user would expect.
The further dissecting of individual command-line parameters may have had its valid roots in the peculiarities of DOS' command-line handling, but to my knowledge all major contemporary operating systems follow a concept akin to Unix, passing a list of parameters instead of a monolithic command line, and burdening the respective command shells with the task of dissecting command lines into parameters.
Therefore I suggest to disable this anachronistic feature in favor of contemporary standards; a compiler flag might be used to allow for easy re-enabling of the feature, for compiling POV-Ray on exotic targets.
It has been pointed out that the described behaviour differs from 3.6, so I'm promoting this to a bug and changing the title.
Comments
Comment by Thorsten Fröhlich (thorsten) - Sunday, 20 June 2010, 10:49 GMT+5
This is a platform specific code issue. POV-Ray's internal command-line parser can handle both as needed. The method ProcessOptions::ParseString offers a parameter to handle this case correctly.
Comment by Andrey Zholos (aaz) - Thursday, 19 May 2011, 16:46 GMT+5
Another parsing problem:
Passing the singleswitch flag to ParseString solves this, but I think the second form should be accepted even without singleswitch.
Comment by Christoph Lipka (clipka) - Friday, 26 August 2011, 05:37 GMT+5
This is a platform specific code issue. POV-Ray's internal command-line parser can handle both as needed.
Not really, at least if you consider vfeSession::SetOptions(...) in the generic vfecontrol.cpp as part of POV-Ray's internal command-line parser. That's where ProcessOptions::ParseString(...) is called from, but it never passes the singleswitch parameter (so it always defaults to false).
Comment by Thorsten Fröhlich (thorsten) - Wednesday, 05 September 2012, 09:35 GMT+5
It can't detect this without singleswitch because the quotes get removed otherwise. Then it is faced with an ambiguous "Declare=" "foo=" "bar" and can't know "bar" is meant to be a string in the tokenizer without singleswitch.
The text was updated successfully, but these errors were encountered: