unhelpful error message: unknown option ""

John E Hein <[email protected]>
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
After updating from 2.2.6 to 2.2.9, I had a problem with the
--no-parameter-indentation option I was using.

As it turns out, it was removed in favor of using
just --parameter-indentation0.  The documentation was not
updated.  That's a different bug.

When I tried to use 2.2.9 for the first time, I got this:

% indent -npro -nip
indent: unknown option ""
% indent -npro --no-parameter-indentation
indent: unknown option ""

That's not a very useful error message.  It looks like somewhere
between 2.2.6 & 2.2.9, it was broken due to a new way that long/short
options are parsed.

Note that it was broken in a different way in 2.2.6 (didn't print the
same # of dashes used on the command line - or didn't strip them
correctly), but at least it was more useful.

Anyway, here's a patch to fix the error message.


--- args.c.orig	Sun Nov 10 14:02:48 2002
+++ args.c	Wed Nov  2 12:24:15 2005
@@ -714,7 +714,7 @@
 
     if (!found)
     {
-        fprintf (stderr, _("indent: unknown option \"%s\"\n"), option - 1);
+        fprintf (stderr, _("indent: unknown option \"%s\"\n"), option);
         exit (invocation_error);
     }
     else
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.