On 10/20/2011 08:48 AM, Bruce Korb wrote:
You may have this in the queue already, but just in case:

POSIX now specifies that if a standard utility has extended options,
then you accomplish it with ``-W option-name[=opt-arg]''.

Not quite. POSIX specifies only that -W is reserved for implementation-defined extensions. glibc's getopt_long _happens_ to have the implementation-defined extension that '-W foo' is equivalent to '--foo', so it would make sense that bash support the same extension as glibc for consistency among GNU programs, but that is _not_ a POSIX requirement.

I wouldn't care, but I wanted to add ``--noprofile --norc''
to the command line and, for debugging purposes, I aliased "bash"
to "bash -x". Oops. Two issues:

1. I'd be nice to be able to interleave short and long options, and
2. "bash -x -W noprofile -W norc" should also work.

Bash currently doesn't use getopt_long for option parsing, but rolls its own parser. A patch to make the bash parser support mixed long and short options would also be welcome in my mind.

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to