Sebastian Nowicki wrote:
On 22/05/2008, at 7:13 AM, Xavier wrote:
Because you need to use -- to separate the getopt options from the argument, this is all in the manpage actually, I just figured that :) getopt -o abc -- $@" That is what makepkg does.
Yes, in GNU's getopt it works like that, but not in the BSD getopt. Even if "getopt -o abc -- $@" is used, you still get something like "-- abc -- -a -b -c", because it thinks that "-o abc -- $@" is what it has to process. BSD's getopt only takes the valid short options as the first parameter, and then the arguments to be processed [1].
Actually I am confused. If we want to use that compatible format, getopt abc $@, then we can't use long options anymore?
It appears so, which is very bad.
Ah I see.. As I said earlier, we were using getopts before getopt : http://projects.archlinux.org/?p=pacman.git;a=commitdiff;h=54b71f0427e87e6d5... So it basically means we need to revert that commit for portability? The new way looks much nicer... I would like to have Aaron and Dan inputs here :P