[pacman-dev] [PATCH] Fix command line argument parsing in makepkg
sebnow at gmail.com
Thu May 22 01:33:46 EDT 2008
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 .
> Actually I am confused. If we want to use that compatible format,
> abc $@, then we can't use long options anymore?
It appears so, which is very bad.
More information about the pacman-dev