[Top][All Lists]

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

Re: cut: invalid option -- [BLANKS]

From: Eric Blake
Subject: Re: cut: invalid option -- [BLANKS]
Date: Wed, 13 Feb 2008 06:46:08 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071031 Thunderbird/ Mnenhy/

Hash: SHA1

According to address@hidden on 2/12/2008 4:34 PM:
| $ cut -s' '
| cut: invalid option --
| Try `cut --help' for more information.
| What do you mean, "  "?
| I typed an -s. Give a proper error message.

Your problem is that -s does not take an argument.  So according to getopt
rules, you did the equivalent of "cut -s '- '".  But since there is no
such option as '- ', you get the default getopt warning message that space
is not a recognized short option (and cut recognized your -s just fine).
You would get that message from any application that uses getopt when you
hand it an invalid short option, whether or not the invalid option was
bundled behind other short options that don't take arguments.

I will admit, however, that the error message:

"cut: invalid option --  "

could be better rendered as

"cut: invalid option -- ' '"

but that would make the gnulib getopt implementation drift from glibc.
Maybe you're better off reporting this to glibc.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

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