bug-coreutils
[Top][All Lists]
Advanced

[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:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
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
-----BEGIN PGP SIGNATURE-----
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

iD8DBQFHsvSg84KuGfSFAYARAq9WAJ9Yr1TNcGi2rPFBUZof5x/WAWSOLQCffCh2
KjlBIPt6KDrawdAuiA3kjnM=
=o10G
-----END PGP SIGNATURE-----




reply via email to

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