mirror of
https://github.com/openvswitch/ovs
synced 2025-10-11 13:57:52 +00:00
ovs-appctl: Rename 'help' to 'list-commands'.
Having 'ovs-appctl help' and 'ovs-appctl --help' print different output is confusing. This commit renames the 'help' to 'list-commands'. Also, future patches will add the 'list-commands' to other ovs-* commands, and the output will be used by bash command-line completion script. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -63,8 +63,8 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
|
||||
static struct shash commands = SHASH_INITIALIZER(&commands);
|
||||
|
||||
static void
|
||||
unixctl_help(struct unixctl_conn *conn, int argc OVS_UNUSED,
|
||||
const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
|
||||
unixctl_list_commands(struct unixctl_conn *conn, int argc OVS_UNUSED,
|
||||
const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
|
||||
{
|
||||
struct ds ds = DS_EMPTY_INITIALIZER;
|
||||
const struct shash_node **nodes = shash_sort(&commands);
|
||||
@@ -93,7 +93,7 @@ unixctl_version(struct unixctl_conn *conn, int argc OVS_UNUSED,
|
||||
|
||||
/* Registers a unixctl command with the given 'name'. 'usage' describes the
|
||||
* arguments to the command; it is used only for presentation to the user in
|
||||
* "help" output.
|
||||
* "list-commands" output.
|
||||
*
|
||||
* 'cb' is called when the command is received. It is passed an array
|
||||
* containing the command name and arguments, plus a copy of 'aux'. Normally
|
||||
@@ -243,7 +243,8 @@ unixctl_server_create(const char *path, struct unixctl_server **serverp)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
unixctl_command_register("help", "", 0, 0, unixctl_help, NULL);
|
||||
unixctl_command_register("list-commands", "", 0, 0, unixctl_list_commands,
|
||||
NULL);
|
||||
unixctl_command_register("version", "", 0, 0, unixctl_version, NULL);
|
||||
|
||||
server = xmalloc(sizeof *server);
|
||||
|
@@ -14,16 +14,16 @@ AT_CHECK([PYAPPCTL -t ovsdb-server exit], [0], [])
|
||||
OVS_WAIT_WHILE([test -s ovsdb-server.pid])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([unixctl ovs-vswitchd help - Python])
|
||||
AT_SETUP([unixctl ovs-vswitchd list-commands - Python])
|
||||
AT_SKIP_IF([test $HAVE_PYTHON = no])
|
||||
OVS_VSWITCHD_START
|
||||
|
||||
AT_CHECK([APPCTL help], [0], [stdout])
|
||||
AT_CHECK([APPCTL list-commands], [0], [stdout])
|
||||
AT_CHECK([head -1 stdout], [0], [dnl
|
||||
The available commands are:
|
||||
])
|
||||
mv stdout expout
|
||||
AT_CHECK([PYAPPCTL help], [0], [expout])
|
||||
AT_CHECK([PYAPPCTL list-commands], [0], [expout])
|
||||
|
||||
OVS_VSWITCHD_STOP
|
||||
AT_CLEANUP
|
||||
|
@@ -73,7 +73,7 @@ Note that these commands are different from the \fB\-\-help\fR and
|
||||
\fB\-\-version\fR options that return information about the
|
||||
\fBovs\-appctl\fR utility itself.
|
||||
.
|
||||
.IP "\fBhelp\fR"
|
||||
.IP "\fBlist-commands\fR"
|
||||
Lists the commands supported by the target.
|
||||
.
|
||||
.IP "\fBversion\fR"
|
||||
|
@@ -89,7 +89,7 @@ usage: %s [TARGET] COMMAND [ARG...]\n\
|
||||
Targets:\n\
|
||||
-t, --target=TARGET pidfile or socket to contact\n\
|
||||
Common commands:\n\
|
||||
help List commands supported by the target\n\
|
||||
list-commands List commands supported by the target\n\
|
||||
version Print version of the target\n\
|
||||
vlog/list List current logging levels\n\
|
||||
vlog/set [SPEC]\n\
|
||||
|
Reference in New Issue
Block a user