linux-cp: fix some CLI error messages 09/37109/2
authorMatthew Smith <mgsmith@netgate.com>
Mon, 12 Sep 2022 19:54:43 +0000 (19:54 +0000)
committerNeale Ranns <neale@graphiant.com>
Mon, 19 Sep 2022 01:24:19 +0000 (01:24 +0000)
commit59abf89dda5e0d216892af503898c1307aae0c3d
treee9c87f3169952d49099be2d9a5224449d8683786
parentccd83cb50194c6682a9c71b585d184c11ce11417
linux-cp: fix some CLI error messages

Type: fix

If unrecognized input was provided to the commands which add or delete a
pair, the error message was being created incorrectly and only displayed
something like "unknown input `'". Provide the correct argument to
format_unformat_error so that the actual unrecognized input is printed.

There also was no error or useful information printed if only the base
command were provided without any additional arguments. This should
print a warning about what required data was missing. Reorganize code to
handle this and to make sure that memory gets freed appropriately.

Change-Id: If454714f50cf41b3b56cfadfbf017f1d160e13a4
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
src/plugins/linux-cp/lcp_cli.c