Index: /branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.data/write_vectors.c
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.data/write_vectors.c	(revision 34885)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.data/write_vectors.c	(revision 34886)
@@ -10,4 +10,9 @@
   Vector **vec;
 
+  if ((N = get_argument (argc, argv, "-h"))) goto usage;
+  if ((N = get_argument (argc, argv, "--h"))) goto usage;
+  if ((N = get_argument (argc, argv, "-help"))) goto usage;
+  if ((N = get_argument (argc, argv, "--help"))) goto usage;
+
   /* look for format option */
   format = (char *) NULL;
@@ -17,13 +22,18 @@
     remove_argument (N, &argc, argv);
   }
+  if ((N = get_argument (argc, argv, "-format"))) {
+    if (format) {
+      gprint (GP_ERR, "ERROR: do not mix -f and -format\n");
+      free (format);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    format = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
 
   /* option generate a FITS output table */
   FITS = NULL;
   if ((N = get_argument (argc, argv, "-fits"))) {
-    if (format) {
-      gprint (GP_ERR, "ERROR: do not mix -fits and -format\n");
-      free (format);
-      return (FALSE);
-    }
     remove_argument (N, &argc, argv);
     FITS = strcreate (argv[N]);
@@ -61,5 +71,6 @@
 
   if (argc < 3) {
-    gprint (GP_ERR, "USAGE: write [-append] [-f \"format\"] file vector vector ...\n");
+    gprint (GP_ERR, "USAGE: write [options] file vector vector ...\n");
+    gprint (GP_ERR, "OPTIONS: [-header] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n");
     return (FALSE);
   }
@@ -222,4 +233,30 @@
   return (TRUE);
 
+ usage:
+    gprint (GP_ERR, "USAGE: write [options] file vector vector ...\n");
+    gprint (GP_ERR, "OPTIONS: [-header] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n\n");
+
+    gprint (GP_ERR, "OPTIONS: \n");
+    gprint (GP_ERR, "  -header : add a descriptive header line to ascii or csv output\n");
+    gprint (GP_ERR, "  -append : write to the end of the existing file\n");
+    gprint (GP_ERR, "  -fits NAME : write a fits table (extention name is NAME, column names match vector names)\n");
+    gprint (GP_ERR, "  -csv : write a comma-separated values file (eg, to read in excel)\n");
+    gprint (GP_ERR, "  -f \"format\" : provide formatting codes for output:\n");
+    gprint (GP_ERR, "    ascii / csv : format consists of c-style format codes in form %NN.Md\n");
+    gprint (GP_ERR, ",     the following codes are allowed\n");
+    gprint (GP_ERR, "        %e -- double, %f -- float\n");
+    gprint (GP_ERR, "        %d -- int, %c -- char, %x -- hex int\n");
+    gprint (GP_ERR, "    FITS : format consists of the following FITS binary table format codes:\n");
+    gprint (GP_ERR, "      B : 1 byte int\n");    
+    gprint (GP_ERR, "      I : 2 byte int\n");    
+    gprint (GP_ERR, "      J : 4 byte int\n");    
+    gprint (GP_ERR, "      K : 8 byte int\n");    
+    gprint (GP_ERR, "      D : 4 byte float\n");    
+    gprint (GP_ERR, "      F : 1 byte float\n");    
+    gprint (GP_ERR, "   -h : this help listing\n");
+    gprint (GP_ERR, "   --h : this help listing\n");
+    gprint (GP_ERR, "   -help : this help listing\n");
+    gprint (GP_ERR, "   --help : this help listing\n");
+    return FALSE;
 }
 
Index: /branches/eam_branches/ipp-20121219/Ohana/src/opihi/lib.shell/VectorIO.c
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/opihi/lib.shell/VectorIO.c	(revision 34885)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/opihi/lib.shell/VectorIO.c	(revision 34886)
@@ -23,5 +23,5 @@
 	goto escape;
       }
-      if ((*ptr != 'B') && (*ptr != 'I') && (*ptr != 'J') && (*ptr != 'D') && (*ptr != 'E')) {
+      if ((*ptr != 'B') && (*ptr != 'I') && (*ptr != 'J') && (*ptr != 'K') && (*ptr != 'D') && (*ptr != 'E')) {
 	gprint (GP_ERR, "error in binary table format %s: invalid character %c\n", format, *ptr);
 	goto escape;
