Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

par_to_use.C

Go to the documentation of this file.
00001 
00002 // par_to_use.C: Turn the list of parameters used by pgetopt
00003 //               into a "Usage" statement.
00004 
00005 // Name shortened to satisfy some library managers.
00006 
00007 #include "stdinc.h"
00008 
00009 void params_to_usage(ostream& s, char* name, char* param_string)
00010 {
00011     int i = 0;
00012 
00013     while (*param_string) {
00014         if (++i == 1) s << "Usage: " << name;
00015 
00016         if (*param_string == ':')
00017             s << " #";
00018         else if (*param_string == '.')
00019             s << " [#]";
00020         else {
00021             if (i > 1) s << "]";
00022             s << " [-" << *param_string;
00023         }
00024 
00025         param_string++;
00026     }
00027 
00028     if (i > 0) s << "]" << endl;
00029 }

Generated at Sun Feb 24 09:57:11 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001