Opened 23 years ago

Closed 23 years ago

Last modified 6 years ago

#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 SF/pixels, 23 years ago

Priority: normallow

comment:2 by SF/mnepomuk, 23 years ago

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)

comment:3 by SF/pixels, 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 SF/bbrox, 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 SF/bbrox, 23 years ago

Owner: set to SF/bbrox

comment:6 by SF/ender, 23 years ago

Any progress on this? :)

comment:7 by SF/mnepomuk, 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 SF/bbrox, 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:9 by SF/mnepomuk, 23 years ago

More pasta ;-) but it works, great !

comment:10 by SF/bbrox, 23 years ago

Resolution: fixed
Status: newclosed

comment:11 by SF/bbrox, 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 digitall, 6 years ago

Component: --Other--
Note: See TracTickets for help on using tickets.