[pisa-src] r833 - in trunk: client/pisacd libpisa trust-point/pisasd

Author: Tjansen
Date: Wed Aug 19 15:59:15 2009
New Revision: 833

Log:
Added some usage hints to pisa{s,c}dconf when no argument is given.

Modified:
   trunk/client/pisacd/pisaconftool.c
   trunk/libpisa/pisaconf.c
   trunk/trust-point/pisasd/pisaconftool.c

Modified: trunk/client/pisacd/pisaconftool.c
==============================================================================
--- trunk/client/pisacd/pisaconftool.c  Wed Aug 19 15:31:34 2009        (r832)
+++ trunk/client/pisacd/pisaconftool.c  Wed Aug 19 15:59:15 2009        (r833)
@@ -14,8 +14,13 @@
 #include "pisacdconf.h"
 #include "debug.h"
 
-const char *usage_text = "Nothing yet.\n";
+const char *usage_text =
+"Client options:\n"
+"\tnone\n"
+;
+
 extern int pisa_conf_dst_port;
+extern char *pisa_conf_usage_common;
 
 int main(int argc, char *argv[])
 {
@@ -23,8 +28,8 @@
 
        switch (pisa_cdconf_parse(argc - 1, &argv[1]) == 1) {
                case 1:
-                       PISA_ERROR("Unknown parameter\n");
-                       PISA_ERROR("Usage: \n%s", usage_text);
+                       PISA_ERROR("Usage:\n\n%s%s", pisa_conf_usage_common,
+                                  usage_text);
                        return 1;
                case 2:
                        return 2;

Modified: trunk/libpisa/pisaconf.c
==============================================================================
--- trunk/libpisa/pisaconf.c    Wed Aug 19 15:31:34 2009        (r832)
+++ trunk/libpisa/pisaconf.c    Wed Aug 19 15:59:15 2009        (r833)
@@ -198,6 +198,12 @@
        return 0;
 }
 
+char *pisa_conf_usage_common =
+"Common options:\n"
+"\tdebuglevel\t: Set the debug level to 'all', 'medium', 'none'.\n"
+"\tdebugmask\t: 'set', 'add' or 'del' bits in the debugmask.\n"
+;
+
 /**
  * Parse a pisasdconf debuglevel line.
  * @param argc number of arguments

Modified: trunk/trust-point/pisasd/pisaconftool.c
==============================================================================
--- trunk/trust-point/pisasd/pisaconftool.c     Wed Aug 19 15:31:34 2009        
(r832)
+++ trunk/trust-point/pisasd/pisaconftool.c     Wed Aug 19 15:59:15 2009        
(r833)
@@ -16,9 +16,12 @@
 #include "debug.h"
 
 const char *usage_text=
-"reload\t\t: Reloads the PisaSD configuration.\n"
+"Server options:\n"
+"\treload\t\t: Reload the PisaSD configuration.\n"
 ;
+
 extern int pisa_conf_dst_port;
+extern char *pisa_conf_usage_common;
 
 int main(int argc, char *argv[])
 {
@@ -26,8 +29,8 @@
 
        switch (pisa_sdconf_parse(argc - 1, &argv[1]) == 1) {
                case 1:
-                       PISA_ERROR("Unknown parameter\n");
-                       PISA_ERROR("Usage: \n%s",usage_text);
+                       PISA_ERROR("Usage:\n\n%s%s", pisa_conf_usage_common,
+                                  usage_text);
                        return 1;
                case 2:
                        return 2;

Other related posts:

  • » [pisa-src] r833 - in trunk: client/pisacd libpisa trust-point/pisasd - Thomas Jansen