summaryrefslogtreecommitdiff
path: root/accel-cmd
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-11-12 16:33:49 +0100
committerDmitry Kozlov <xeb@mail.ru>2014-11-17 17:49:50 +0300
commitcfead0b09e56c0740d6dae50b8ac7a0b07c06dc4 (patch)
tree0d973bf4016f0a6600f744f0d413d9627dba1a24 /accel-cmd
parent5a7474b41970e8cdf5ad98f7daa74814f5667a5e (diff)
downloadaccel-ppp-cfead0b09e56c0740d6dae50b8ac7a0b07c06dc4.tar.gz
accel-ppp-cfead0b09e56c0740d6dae50b8ac7a0b07c06dc4.zip
accel-cmd: improve help message
New users typically use the -h or --help parameters to figure out how to use accel-cmd. But this only displays accel-cmd options, so users have no way to learn which accel-ppp commands are available. This patch improves the help message to introduce the "help" command which users can use to learn about other accel-ppp commands. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-cmd')
-rw-r--r--accel-cmd/accel-cmd.17
-rw-r--r--accel-cmd/accel_cmd.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/accel-cmd/accel-cmd.1 b/accel-cmd/accel-cmd.1
index ee2766e..634b4e3 100644
--- a/accel-cmd/accel-cmd.1
+++ b/accel-cmd/accel-cmd.1
@@ -11,6 +11,10 @@ accel-cmd \- send commands to accel-ppp
.IR COMMAND "s to accel-ppp's tcp interface and displays the result on"
.RI "standard output. If no " COMMAND " is supplied, then"
.BR accel-cmd " reads and sends data from its standard input."
+.P
+The "help"
+.IR COMMAND " can be used to get information about available " COMMAND "s and "
+their syntax.
.SH OPTIONS
.TP
.BR \-f " \fIFAMILY\fR, " \-\-family "=\fIFAMILY\fR"
@@ -52,6 +56,9 @@ Display version number and exit.
Display help message and exit.
.SH EXAMPLES
.TP
+Get information about available commands:
+$ accel-cmd help
+.TP
Send the "show sessions" command to accel-ppp on localhost and display \
the result on standard output:
$ accel-cmd show sessions
diff --git a/accel-cmd/accel_cmd.c b/accel-cmd/accel_cmd.c
index e392d21..d73c9c2 100644
--- a/accel-cmd/accel_cmd.c
+++ b/accel-cmd/accel_cmd.c
@@ -556,9 +556,11 @@ static void print_help(const char *name)
printf("\t-v, --verbose\t- Verbose output.\n");
printf("\t-V, --version\t- Display version number and exit.\n");
printf("\t-h, --help\t- Display this help message and exit.\n");
- printf("\n\tCOMMAND is the accel-ppp command line to be executed.\n");
- printf("\tIf no COMMAND is provided, then data read from standard"
- " input is forwarded to accel-ppp.\n");
+ printf("\n\tCOMMAND is the accel-ppp command line to be executed");
+ printf(" (if omitted, commands are read from standard input).\n");
+ printf("\tThe \"help\" command can be used (e.g. \"%s help\") to get"
+ " information about available commands and their syntax.\n",
+ name);
}
int main(int argc, char **argv)