Updates to tools for help and version.
[awesomized/libmemcached] / src / memcp.c
index 9123028b44509fff5007c8c9c92b3825a9d940be..3b846e78fa5025616631a921a752623cd73a4817 100644 (file)
@@ -12,6 +12,9 @@
 #include "client_options.h"
 #include "utilities.h"
 
+#define PROGRAM_NAME "memcp"
+#define PROGRAM_DESCRIPTION "Copy a set of files to a memcached cluster."
+
 /* Prototypes */
 void options_parse(int argc, char *argv[]);
 
@@ -122,6 +125,11 @@ void options_parse(int argc, char *argv[])
   int option_index= 0;
   int option_rv;
 
+  memcached_programs_help_st help_options[]=
+  {
+    {0},
+  };
+
   static struct option long_options[]=
     {
       {"version", no_argument, NULL, OPT_VERSION},
@@ -154,11 +162,11 @@ void options_parse(int argc, char *argv[])
       opt_verbose = OPT_DEBUG;
       break;
     case OPT_VERSION: /* --version or -V */
-      printf("memcache tools, memcp, v1.0\n");
-      exit(0);
+      version_command(PROGRAM_NAME);
+      break;
     case OPT_HELP: /* --help or -h */
-      printf("useful help messages go here\n");
-      exit(0);
+      help_command(PROGRAM_NAME, PROGRAM_DESCRIPTION, long_options, help_options);
+      break;
     case OPT_SERVERS: /* --servers or -s */
       opt_servers= strdup(optarg);
       break;