Printing optc with %c makes sense only when optc is actually a
character. Add logic to also deal with unrecognized long options,
rejected by md_parse_option() rather than get_opt_long_only(). Also
quote the reproduced strings, such that possible included whitespace
can be recognized.
verbose = 1;
break;
}
+ else if (is_a_char (optc))
+ as_bad (_("unrecognized option `-%c%s'"), optc, optarg ? optarg : "");
+ else if (optarg)
+ as_bad (_("unrecognized option `--%s=%s'"), longopts[longind].name, optarg);
else
- as_bad (_("unrecognized option -%c%s"), optc, optarg ? optarg : "");
+ as_bad (_("unrecognized option `--%s'"), longopts[longind].name);
/* Fall through. */
case '?':
Assembler messages:
[^:]*: extension does not apply to the base architecture
-[^:]*: unrecognized option -march=armv2\+mp
+[^:]*: unrecognized option .*-march=armv2\+mp.*
Assembler messages:
[^:]*: extension does not apply to the base architecture
-[^:]*: unrecognized option -march=armv8.1-a\+dotprod
+[^:]*: unrecognized option .*-march=armv8\.1-a\+dotprod.*
Assembler messages:
[^:]*: extension does not apply to the base architecture
-[^:]*: unrecognized option -march=armv7\+idiv
+[^:]*: unrecognized option .*-march=armv7\+idiv.*