GEtOpt optional argument handled incorrectly (?) lazarus / 62-General ---------------------------------------------------------------------- jollytall ยท 2021-10-12 16:48 If the description (https://azrael.digipen.edu/~mmead/www/mg/getopt/index.html) I quoted in my previous topic is correct for short options with optional argument (it seems logic) then such a short option -a with argument test can be written only two ways: Code: [Select]./test -atest ./test -a=testwhile the third way also allowed for mandatory arguments, cannot be used Code: [Select]./test -a testif a is defined as a:: in the ShortOpts (i.e. an option with optional argument) then the last should mean an -a option with no parameter and a non-option value test. As far as I see FPC GetOpts unit does it differently (wrongly), because even the last is interpreted as -a option with test argument.