Print this page
4270 ld(1) argument error reporting is still pretty bad
@@ -1677,12 +1677,23 @@
}
break;
case '?':
DBG_CALL(Dbg_args_option(ofl->ofl_lml, ndx, c, NULL));
+ /*
+ * If the option character is '-', we're looking at a
+ * long option which couldn't be translated, display a
+ * more useful error.
+ */
+ if (optopt == '-') {
+ eprintf(ofl->ofl_lml, ERR_FATAL,
+ MSG_INTL(MSG_ARG_LONG_UNKNOWN),
+ argv[optind-1]);
+ } else {
eprintf(ofl->ofl_lml, ERR_FATAL,
MSG_INTL(MSG_ARG_UNKNOWN), optopt);
+ }
(*usage)++;
break;
default:
break;