[ovs-dev] [PATCH] unixctl: Give better error message for unknown commands.

Ben Pfaff blp at ovn.org
Sat Oct 14 19:47:46 UTC 2017


Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 lib/unixctl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/unixctl.c b/lib/unixctl.c
index 33c5412f1253..d33dcac9426e 100644
--- a/lib/unixctl.c
+++ b/lib/unixctl.c
@@ -287,7 +287,9 @@ process_command(struct unixctl_conn *conn, struct jsonrpc_msg *request)
     params = json_array(request->params);
     command = shash_find_data(&commands, request->method);
     if (!command) {
-        error = xasprintf("\"%s\" is not a valid command", request->method);
+        error = xasprintf("\"%s\" is not a valid command (use "
+                          "\"list-commands\" to see a list of valid commands)",
+                          request->method);
     } else if (params->n < command->min_args) {
         error = xasprintf("\"%s\" command requires at least %d arguments",
                           request->method, command->min_args);
-- 
2.10.2



More information about the dev mailing list