Index: /trunk/docs/pvoconvertGuide.tex
===================================================================
--- /trunk/docs/pvoconvertGuide.tex	(revision 69)
+++ /trunk/docs/pvoconvertGuide.tex	(revision 70)
@@ -426,10 +426,12 @@
 \subsection{Location}
 
-The software has been developed in my local directory:
-\texttt{/DATA/SITAR\_1/whi550/VO/PulsarVO/src}. This has been kept
-under revision control using the Subversion system, and visible on the
-ATNF sourcecode website or through the Trac webpage
+The software has been developed in a local directory on my data disk%
+\footnote{\texttt{/DATA/SITAR\_1/whi550/VO/PulsarVO/src}}. This has
+been kept under revision control using the Subversion system, and
+visible on the ATNF sourcecode website or through the Trac webpage% 
+\footnote{%
 \href{http://sourcecode.atnf.csiro.au/cgi-bin/trac\_pulsarvo.cgi}%
-{http://sourcecode.atnf.csiro.au/cgi-bin/trac\_pulsarvo.cgi}
+{http://sourcecode.atnf.csiro.au/cgi-bin/trac\_pulsarvo.cgi}}
+associated with it.
 
 The working code, however, has been installed in the pulsar
@@ -466,4 +468,37 @@
 
 \subsection{\pvosummary}
+
+This is a utility program to print out key metadata from PSRFITS
+files. The standard functionality of this program is to print out
+basic information about a FITS file: filename, RA, Dec, Beam size,
+Frequency, Date of Observation. It can also produce a csv file that
+lists many more parameters -- the full list, obtainable from
+\texttt{pvosummary -p}, is:
+{\small
+\begin{verbatim}
+Basic parameters written to screen:
+ FILENAME       The FITS file.
+ RAJ            Right Ascension, hh:mm:ss.ss
+ DECJ           Declination, dd:mm:ss.sss 
+ BEAM FWHM      The average full-width-half-maximum of the beam
+                 (averaged between BMAJ and BMIN)
+ OBSFREQ        The central observing frequency
+ DATE-OBS       The UT time and date of the observation, in FITS
+                 format YYYY-MM-DDThh:mm:ss.ssss
+
+Additional parameters included only in csv file:
+ File Location  The full path of the FITS file.
+ Header Version The version of the PSRFITS definition used.
+ Source Name    The SRC_NAME keyword.
+ RAJd           Right Ascension, in decimal degrees.
+ DecJd          Declination, in decimal degrees.
+ BMAJ           The FWHM of the major axis of the beam.
+ BMIN           The FWHM of the minor axis of the beam.
+ BPA            The position angle of the beam.
+ ChanBW         The channel bandwidth (from the HISTORY table).
+ Nchan          Number of channels (from the HISTORY table).
+ Scan length    The SCANLEN keyword.
+ Tbin           Time per bin [ms] (from the HISTORY table).
+\end{verbatim}
 
 \subsection{\pvoconesearch}
Index: /trunk/src/pvo-utils.hh
===================================================================
--- /trunk/src/pvo-utils.hh	(revision 69)
+++ /trunk/src/pvo-utils.hh	(revision 70)
@@ -19,10 +19,12 @@
   /** Help text for pvoconvert -h */
   const std::string pvoconvert_usage_text = 
-"Usage: pvoconvert [options] <survey file>\n\
+"Usage: pvoconvert [options] <survey file(s)> ...\n\
   Options:\n\
-  -H  Use the PH (High Latitude) Survey settings, rather than those for the\n\
-       PM/Multibeam Survey\n\
-  -h  Display this help page.\n\
-  -v  Verbose mode for error/warning messages.\n\
+  -H        Use the PH (High Latitude) Survey settings, rather than those for the\n\
+  --highlat  PM/Multibeam Survey\n\
+  -h        Display this help page.\n\
+  --help\n\
+  -v        Verbose mode for error/warning messages.\n\
+  --verbose\n\
 ---------\n\n\
  PVOConvert converts pulsar survey data into PSRFITS format.\n\
@@ -30,14 +32,17 @@
   specify particular data as coming from the High Latitude survey rather\n\
   than the standard Multibeam survey, use the -h option.\n\
+ Note that more than one input file can be given.\n\
  Output files will be encoded according to the survey type and date & time\n\
   of observation.\n";
   /** Brief help text for pvoconvert -h */
   const std::string pvoconvert_usage_text_short = 
-"Usage: pvoconvert [options] <survey file>\n\
+"Usage: pvoconvert [options] <survey file(s)>\n\
   Options:\n\
-  -H  Use the PH (High Latitude) Survey settings, rather than those for the\n\
-       PM/Multibeam Survey\n\
-  -h  Display the help page.\n\
-  -v  Verbose mode for error/warning messages.\n";
+  -H        Use the PH (High Latitude) Survey settings, rather than those for the\n\
+  --high      PM/Multibeam Survey\n\
+  -h        Display this help page.\n\
+  --help\n\
+  -v        Verbose mode for error/warning messages.\n\
+  --verbose\n";
 
   /** Help text for pvosummary -h */
Index: /trunk/src/pvoconvert.cc
===================================================================
--- /trunk/src/pvoconvert.cc	(revision 69)
+++ /trunk/src/pvoconvert.cc	(revision 70)
@@ -5,4 +5,5 @@
 #include <string>
 #include <unistd.h>
+#include <getopt.h>
 #include "pvo-block.hh"
 #include "pvo-header.hh"
@@ -49,5 +50,5 @@
   PSRFits fitsfile;
   fitsfile.setVerbosity(false);
-  std::string fname;
+  std::vector<std::string> namelist;
   bool usingHighLatitude = false;
 
@@ -57,126 +58,154 @@
   }
 
-  char c;
+  char c, digit_optind = 0;;
   int optCount=0;
-  while( ( c = getopt(argc,argv,"H:v:h") )!=-1){
-    optCount++;
-    switch(c) {
-    case 'v':
+  while (true) {
+    int this_option_optind = optind ? optind : 1;
+    int option_index = 0;
+    static struct option long_options[] = {
+      {"help", 0, 0, 'h'},
+      {"highlat", 0, 0, 'H'},
+      {0, 0, 0, 0}
+    };
+
+    c = getopt_long (argc, argv, "Hvh",
+		     long_options, &option_index);
+
+    if (c == -1) break;
+
+    switch (c) {               
+    case 0:
+      // This is where we deal with -- options that don't have a
+      // single letter equivalent
+      break;
+    case 'v': // use verbose mode
       fitsfile.setVerbosity(true);
-      fname = optarg;
-      break;
-    case 'H':
-      usingHighLatitude = true;
-      fname = optarg;
-      break;
-    case 'h':
+      break;
+    case 'h': // give help statement
       std::cout << PVO::pvoconvert_usage_text;
       return 0;
+      break;
+    case 'H': // High Latitude survey
+      usingHighLatitude = true;
+      break;
+    case '?': // invalid option
+    case ':': // missing an argument
+      std::cout <<  PVO::pvoconvert_usage_text_short;
+      return 1;
+      break;
     default:
-      std::cout << PVO::pvoconvert_usage_text_short;
-      return 1;
-      break;
-    }
-  }
-
-  if(optCount==0) fname = argv[1];
-
-  SURVEY currentSurvey = idSurvey(fname);
-  if(currentSurvey == NONEXISTENT) {
-    std::cerr << "File " << fname <<" does not exist.\n";
-    std::cerr << "Exiting...\n";
-    return 1;
-  }
+      std::cerr << "ERROR: getopt returned character code " <<  c << "\n";
+      break;
+    }
+  }
+
+  if (optind < argc) { 
+    // There is a non-option argument -- must be the file to access
+    while (optind < argc) namelist.push_back( argv[optind++] );
+  }
+
+  for(int i=0; i<namelist.size(); i++){
+
+    std::string fname = namelist[i];
+
+    SURVEY currentSurvey = idSurvey(fname);
+    if(currentSurvey == NONEXISTENT) {
+      std::cerr << "File " << fname <<" does not exist.\n";
+      std::cerr << "Exiting...\n";
+      return 1;
+    }
   
-  if(usingHighLatitude){
-    if(currentSurvey == PM) currentSurvey = PH;
-    else{
-      std::cerr << "Error: you selected the -h option, which means High Latitude survey.\n"
-		<< "But " << fname << " is a " << surveyNames[currentSurvey]
-		<<" file.\nExiting...\n";
-      return 1;
-    }
-  }
-
-  std::string file_loc = "";
-  if(fname[0]!='/'){
-    file_loc = get_current_dir_name();
-    file_loc += "/";
-  }
-  file_loc += fname;
-  std::cerr << "Input file " << file_loc <<" : " << surveyNames[currentSurvey]<<"\n";
-  if(currentSurvey == DUD){
-    std::cerr << "Exiting...\n";
-    return 1;
-  }
-
-  std::ifstream fin;
-  fin.open(fname.c_str(), std::ios::binary);
-
-  bool eof;
-  DataBlock block(currentSurvey);
-  block.readBlock(fin);
+    if(usingHighLatitude){
+      if(currentSurvey == PM) currentSurvey = PH;
+      else{
+	std::cerr << "Error: you selected the -h option, which means High Latitude survey.\n"
+		  << "But " << fname << " is a " << surveyNames[currentSurvey]
+		  <<" file.\nExiting...\n";
+	return 1;
+      }
+    }
+
+    std::string file_loc = "";
+    if(fname[0]!='/'){
+      file_loc = get_current_dir_name();
+      file_loc += "/";
+    }
+    file_loc += fname;
+    std::cerr << "Input file " << file_loc <<" : " << surveyNames[currentSurvey]<<"\n";
+    if(currentSurvey == DUD){
+      std::cerr << "Exiting...\n";
+      return 1;
+    }
+
+    std::ifstream fin;
+    fin.open(fname.c_str(), std::ios::binary);
+
+    bool eof;
+    DataBlock block(currentSurvey);
+    block.readBlock(fin);
   
-  int newBeam = block.getKeyword<int>(IBEAM);
-  int oldBeam;
-  bool newMoveFlag= block.telescopeOK();
-  bool oldMoveFlag;
-
-  fitsfile.setOldFilename(fname);
-  fitsfile.setCommandLine(argc,argv);
-
-  if(fitsfile.initialise(block) == FAILURE){
-    std::cerr << "Could not open PSRFITS file "
-	      << fitsfile.getFITSname()
-	      << ".\nExiting...\n";
-    return 1;
-  }
-
-  do{
-
-    if(fitsfile.getFilestate()==OPEN) fitsfile.writeSubintRow(block);
-
-    oldBeam = newBeam;
-    oldMoveFlag = newMoveFlag;
+    int newBeam = block.getKeyword<int>(IBEAM);
+    int oldBeam;
+    bool newMoveFlag= block.telescopeOK();
+    bool oldMoveFlag;
+
+    fitsfile.setOldFilename(fname);
+    fitsfile.setCommandLine(argc,argv);
+
+    if(fitsfile.initialise(block) == FAILURE){
+      std::cerr << "Could not open PSRFITS file "
+		<< fitsfile.getFITSname()
+		<< ".\nExiting...\n";
+      return 1;
+    }
+
+    do{
+
+      if(fitsfile.getFilestate()==OPEN) fitsfile.writeSubintRow(block);
+
+      oldBeam = newBeam;
+      oldMoveFlag = newMoveFlag;
  	
-    // We've done all we can for this block. Read a new one.
-    eof = !block.readBlock(fin);
-
-    if(!eof){ // if the file is still open
+      // We've done all we can for this block. Read a new one.
+      eof = !block.readBlock(fin);
+
+      if(!eof){ // if the file is still open
       
-      bool fileFull = fitsfile.fitsFull(block) ;
-
-      // get info on the new block
-      newBeam     = block.getKeyword<int>(IBEAM);
-      newMoveFlag = block.telescopeOK();
+	bool fileFull = fitsfile.fitsFull(block) ;
+
+	// get info on the new block
+	newBeam     = block.getKeyword<int>(IBEAM);
+	newMoveFlag = block.telescopeOK();
       
-      if((newBeam != oldBeam) || fileFull ){
-	//if we've moved, or it's a new beam, close the file.
-	fitsfile.closeFile();
+	if((newBeam != oldBeam) || fileFull ){
+	  //if we've moved, or it's a new beam, close the file.
+	  fitsfile.closeFile();
+	}
+
+	if(newMoveFlag){
+
+	  if(!oldMoveFlag){
+	    // if this is true, then we were moving but now are not.
+	    // this means it is a new file.
+	    fitsfile.setNewFile();
+	  }
+
+	  if( fitsfile.getFilestate()==CLOSED ){
+	    // if there is no file open, but we are not moving, 
+	    //  open a new file
+	    fitsfile.initialise(block);
+	  
+	  }
+
+	}
+
       }
-
-      if(newMoveFlag){
-
-	if(!oldMoveFlag){
-	  // if this is true, then we were moving but now are not.
-	  // this means it is a new file.
-	  fitsfile.setNewFile();
-	}
-
-	if( fitsfile.getFilestate()==CLOSED ){
-	  // if there is no file open, but we are not moving, 
-	  //  open a new file
-	  fitsfile.initialise(block);
-	  
-	}
-
-      }
-
-    }
 	
-  }while(!eof);
+    }while(!eof);
   
-  fitsfile.closeFile();
-  fin.close();
+    fitsfile.closeFile();
+    fin.close();
+
+  }
 
   return 0;
Index: /trunk/src/pvosummary.cc
===================================================================
--- /trunk/src/pvosummary.cc	(revision 69)
+++ /trunk/src/pvosummary.cc	(revision 70)
@@ -101,8 +101,11 @@
   }
 
-  if (optind < argc) { // There in a non-option argument -- must be the file to access
+  if (optind < argc) { 
+    // There is a non-option argument -- must be the file to access
     while (optind < argc) namelist.push_back( argv[optind++] );
   }
-  else{
+  else{ 
+    //No file has been specified, so we are working on the directory
+    //as a whole.
     glob_t globbuf1,globbuf2;
     globbuf1.gl_offs = 0;
@@ -132,7 +135,4 @@
   }
 
-//   if(quietMode && !makeCSV){
-//     quietMode = false;
-
   if(!quietMode) printMetadataShort(std::cout,goodlist);
 
