summaryrefslogtreecommitdiff
path: root/src/pjctl.c
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-11-09 18:35:19 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-11-09 18:35:19 +0100
commita607590ecdc63848b9a3e996f64aa7ef975a1711 (patch)
tree9bcae97117655645680f44d766a43b80c03d2e60 /src/pjctl.c
parent98c3af3faaae87e868dd2eb6934f2189a7bb4ed6 (diff)
downloadpjctl-a607590ecdc63848b9a3e996f64aa7ef975a1711.tar.gz
pjctl-a607590ecdc63848b9a3e996f64aa7ef975a1711.tar.bz2
pjctl-a607590ecdc63848b9a3e996f64aa7ef975a1711.zip
Print complete usage
Diffstat (limited to 'src/pjctl.c')
-rw-r--r--src/pjctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pjctl.c b/src/pjctl.c
index 3084d94..91f6bb2 100644
--- a/src/pjctl.c
+++ b/src/pjctl.c
@@ -556,11 +556,12 @@ static struct pjctl_command {
};
static void
-print_commands(struct pjctl *pjctl)
+usage(struct pjctl *pjctl)
{
int i;
- g_print("Commands:\n");
+ g_print("usage: pjctl <hostname> command [args..]\n\n");
+ g_print("commands:\n");
for (i = 0; i < G_N_ELEMENTS(commands); ++i)
g_print(" %s %s\n", commands[i].name, commands[i].help);
}
@@ -581,7 +582,7 @@ main(int argc, char **argv)
g_type_init();
if (argc <= 2) {
- print_commands(&pjctl);
+ usage(&pjctl);
return 1;
}
@@ -595,7 +596,7 @@ main(int argc, char **argv)
/* Nothing got into queue? User gave invalid command. */
if (g_list_length(pjctl.queue) == 0) {
g_printerr("error: invalid command\n");
- print_commands(&pjctl);
+ usage(&pjctl);
return 1;
}