-static const struct command all_commands[] = {
- { "list-dbs", 1, 1, do_list_dbs },
- { "get-schema", 2, 2, do_get_schema },
- { "get-schema-version", 2, 2, do_get_schema_version },
- { "list-tables", 2, 2, do_list_tables },
- { "list-columns", 2, 3, do_list_columns },
- { "transact", 2, 2, do_transact },
- { "monitor", 3, INT_MAX, do_monitor },
- { "dump", 2, 2, do_dump },
- { "help", 0, INT_MAX, do_help },
- { NULL, 0, 0, NULL },
+/* All command handlers (except for "help") are expected to take an optional
+ * server socket name (e.g. "unix:...") as their first argument. The socket
+ * name argument must be included in max_args (but left out of min_args). The
+ * command name and socket name are not included in the arguments passed to the
+ * handler: the argv[0] passed to the handler is the first argument after the
+ * optional server socket name. The connection to the server is available as
+ * global variable 'rpc'. */
+static const struct ovsdb_client_command all_commands[] = {
+ { "list-dbs", NEED_RPC, 0, 0, do_list_dbs },
+ { "get-schema", NEED_DATABASE, 0, 0, do_get_schema },
+ { "get-schema-version", NEED_DATABASE, 0, 0, do_get_schema_version },
+ { "list-tables", NEED_DATABASE, 0, 0, do_list_tables },
+ { "list-columns", NEED_DATABASE, 0, 1, do_list_columns },
+ { "transact", NEED_RPC, 1, 1, do_transact },
+ { "monitor", NEED_DATABASE, 1, INT_MAX, do_monitor },
+ { "dump", NEED_DATABASE, 0, 0, do_dump },
+
+ { "help", NEED_NONE, 0, INT_MAX, do_help },
+
+ { NULL, 0, 0, 0, NULL },