#202 closed defect (fixed)
Command line parsing
Reported by: | SF/pixels | Owned by: | SF/bbrox |
---|---|---|---|
Priority: | low | Component: | --Other-- |
Version: | Keywords: | ||
Cc: | Game: |
Description
Well, now that the command line does accept white spaces between the option and the argument, we can no more correctly use the optionnal switches. For example:
scummvm -d tentacle
will not work.
Ticket imported from: #549738. Ticket imported from: bugs/202.
Change History (12)
comment:1 by , 23 years ago
Priority: | normal → low |
---|
comment:2 by , 23 years ago
comment:3 by , 23 years ago
There is a new option with an optionnal value now: '-w'. And using getopt would mean having the getopt1.c file since it is not quite std.
comment:4 by , 23 years ago
Well, I will see what I can do without resorting to use getopt or adding still more dependencies to ScummVM. Should not be *that* hard to do :-)
comment:5 by , 23 years ago
Owner: | set to |
---|
comment:7 by , 23 years ago
Well, optional parameters do not work (if that parameter
preceds the game name).
Either drop that "space between parameter and value" or
drop the optional parameters.
comment:8 by , 23 years ago
Well, I fixed this in the latest CVS release. Could you please all torture the command line parser to see if I missed anything ?
Otherwise, it may break config file support, I need to check with the author of this code :-)
comment:10 by , 23 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:11 by , 23 years ago
Man, you never saw real spaghetti code :-) This command line parsing code is pure beauty !!!
More seriously, closing the bug as it seems to work fine and that I did not get any complain yet about it.
comment:12 by , 6 years ago
Component: | → --Other-- |
---|
Hmm, the only parameter with an optional value was '-d', which defaults to 1. Use '-d1' from now (fix syntax/readme.txt).
(Spagghetti-like parseCommandline() is ugly -> getopt() solves this)