bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New flag option request


From: Eric Blake
Subject: Re: New flag option request
Date: Thu, 20 Oct 2011 09:03:13 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15

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   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]