afb-client-demo: improved usage message 51/14351/1
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Fri, 1 Jun 2018 12:38:11 +0000 (14:38 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Wed, 13 Jun 2018 15:15:14 +0000 (17:15 +0200)
Change-Id: Ia529be2bf17d9bce3adfc5cb052afd724ae7bbdf
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
src/afb-client-demo.c

index 6a0fef5..ba43cc9 100644 (file)
@@ -96,6 +96,19 @@ static void usage(int status, char *arg0)
        name = name ? name + 1 : arg0;
        fprintf(status ? stderr : stdout, "usage: %s [-H [-r]] [-b] [-e] uri [api verb [data]]\n", name);
        fprintf(status ? stderr : stdout, "       %s -d [-H [-r]] [-b] [-e] uri [verb [data]]\n", name);
+    fprintf(status ? stderr : stdout, "\n" \
+        "allowed options\n" \
+        "  --break, -b         Break connection just after event/call has been emitted.\n" \
+        "  --direct, -d        Direct api\n" \
+        "  --echo, -e          Echo inputs\n" \
+        "  --help, -h          Display this help\n" \
+        "  --human, -H         Display human readable JSON\n" \
+        "  --raw, -r           Raw output (default)\n" \
+        "Example:\n" \
+        " %s --human 'localhost:1234/api?token=HELLO&uuid=magic' hello ping\n"
+        "\n", name
+    );
+
        exit(status);
 }