OBVIOUS Use report_unrecognized_option_error in 'demangle' and 'info macro' commands.
Rather than have some local logic to throw an error for an unrecognized option,
use the new cli-utils.h function throwing an error.
At the same time, fix some wrong indentation in info_macro_command
and fix a small bug in 'demangle' error handling:
Without the patch:
(gdb) demangle -L c++ abcd
Unrecognized option 'c++' to demangle command. Try "help demangle".
(gdb)
With the patch:
(gdb) demangle -L c++ abcd
Unrecognized option '-L' to demangle command. Try "help demangle".
2018-10-27 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* macrocmd.c (info_macro_command): Use report_unrecognized_option_error
to report a bad option and fix indentation.
* demangle.c (demangle_command): Use report_unrecognized_option_error
to report a bad option and correctly report the bad option.