News:

Latest versions:
Server plugin: 0.5.1
MVP dongle: 0.5.2
Raspberry Pi client: 0.5.2
Windows client: 0.5.2-1

Main Menu

patch for improved CLI usage message

Started by dingo35, November 27, 2014, 08:15:22

Previous topic - Next topic

dingo35

Hi all,

Always when I am going to play with vompclient I keep forgetting which command line parameters I need to get the logging on screen. The "usage" message when doing vompclient -h does not help me, so here is a patch to improve the help message:

diff -Naur vompclient.old/main.cc vompclient.new/main.cc
--- vompclient.old/main.cc  2014-11-17 10:26:07.352924435 +0100
+++ vompclient.new/main.cc  2014-10-15 12:57:19.607563854 +0200
@@ -129,7 +129,7 @@
   char* setServer = NULL;
   int c;

-  while ((c = getopt(argc, argv, "cdns:")) != -1)
+  while ((c = getopt(argc, argv, "cdhns:")) != -1)
   {
     switch (c)
     {
@@ -144,11 +144,15 @@
       case 's':
         setServer = optarg;
         break;
-      case '?':
-        printf("Unknown option\n");
-        return 1;
+      case 'h':
       default:
-        printf("Option error\n");
+        printf("Usage: vompclient [options]\n");
+       printf("Options:\n");
+       printf("  -c        set 'crashed' variable\n");
+       printf("  -d        show debug messages on standard output; implies -n\n");
+       printf("  -n        do NOT daemonize into background\n");
+       printf("  -s server set 'setServer' variable to server\n");
+       printf("  -h        show this help message\n");
         return 1;
     }
   }


Perhaps someone (Marten?) can improve on the -c and -s message, I really can't figure out what this is doing!

Marten, could you put this into git? Thanks!