patch to add getopt parsing to expr
Here's a patch to add getopt(3) support to expr so that -- is accepted as
required by POSIX. This was pointed out by vstemen on IRC. I'll
commit sometime after the release if there are no objections.
Updated by josepht almost 14 years ago
Since POSIX requires arguments beginning with '-' to be options
shouldn't the following result in an error?
expr -d=zzz : '.*=\(.*\)'
expr -- -d=zzz : '.*=\(.*\)'
should be the correct usage. I opted to use getopt() since FreeBSD's
e. The "" was inadvertently left in the patch.