Revision: 56582
          http://sourceforge.net/p/brlcad/code/56582
Author:   tbrowder2
Date:     2013-08-05 15:35:41 +0000 (Mon, 05 Aug 2013)
Log Message:
-----------
standardize usage strings for man-pageless progs; add optstring var for 
bu_getopts

Modified Paths:
--------------
    brlcad/trunk/src/conv/jack/g-jack.c
    brlcad/trunk/src/sig/c-d.c
    brlcad/trunk/src/sig/d-a.c
    brlcad/trunk/src/sig/ddisp.c
    brlcad/trunk/src/sig/dfft.c
    brlcad/trunk/src/sig/dpeak.c
    brlcad/trunk/src/sig/dwin.c
    brlcad/trunk/src/sig/ihist.c
    brlcad/trunk/src/util/fix_polysolids.c
    brlcad/trunk/src/util/pixcount.c
    brlcad/trunk/src/util/plot3stat.c

Modified: brlcad/trunk/src/conv/jack/g-jack.c
===================================================================
--- brlcad/trunk/src/conv/jack/g-jack.c 2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/conv/jack/g-jack.c 2013-08-05 15:35:41 UTC (rev 56582)
@@ -38,12 +38,15 @@
 #include "plot3.h"
 
 
-static const char usage[] = "\
-Usage: %s [-v] [-d] [-f] [-xX lvl] [-u eu_dist]\n\
-       [-a abs_tess_tol] [-r rel_tess_tol] [-n norm_tess_tol]\n\
-       [-D dist_calc_tol]\n\
-       [-p prefix] brlcad_db.g object(s)\n";
+static const char usage[] =
+  "Usage: %s [-v] [-d] [-f] [-xX lvl] [-u eu_dist]\n"
+  "       [-a abs_tess_tol] [-r rel_tess_tol] [-n norm_tess_tol]\n"
+  "       [-D dist_calc_tol]\n"
+  "       [-p prefix] brlcad_db.g object(s)\n"
+  ;
 
+static const char optstring[] = "a:dfn:p:r:u:vx:D:P:X:";
+
 static int     NMG_debug;      /* saved arg of -X, for longjmp handling */
 static int     verbose;
 static int     no_file_output=0;       /* -f:  Don't bother writing output 
files */
@@ -449,7 +452,7 @@
     BU_LIST_INIT(&RTG.rtg_vlfree);     /* for vlist macros */
 
     /* Get command line arguments. */
-    while ((c = bu_getopt(argc, argv, "a:dfn:p:r:u:vx:D:P:X:")) != -1) {
+    while ((c = bu_getopt(argc, argv, optstring)) != -1) {
        switch (c) {
            case 'a':           /* Absolute tolerance. */
                ttol.abs = atof(bu_optarg);

Modified: brlcad/trunk/src/sig/c-d.c
===================================================================
--- brlcad/trunk/src/sig/c-d.c  2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/sig/c-d.c  2013-08-05 15:35:41 UTC (rev 56582)
@@ -31,8 +31,7 @@
 #include "vmath.h"
 
 
-static const char usage[] = "\
-Usage: c-d -r -i -m -p -z < complex_data > doubles\n";
+static const char usage[] = "Usage: c-d -r -i -m -p -z < complex_data > 
doubles\n";
 
 int rflag = 0;
 int iflag = 0;

Modified: brlcad/trunk/src/sig/d-a.c
===================================================================
--- brlcad/trunk/src/sig/d-a.c  2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/sig/d-a.c  2013-08-05 15:35:41 UTC (rev 56582)
@@ -35,8 +35,7 @@
 
 int nflag = 0;
 
-static const char usage[] = "\
-Usage: d-a [-n] < doubles > ascii\n";
+static const char usage[] = "Usage: d-a [-n] < doubles > ascii\n";
 
 int
 main(int argc, char **argv)

Modified: brlcad/trunk/src/sig/ddisp.c
===================================================================
--- brlcad/trunk/src/sig/ddisp.c        2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/sig/ddisp.c        2013-08-05 15:35:41 UTC (rev 56582)
@@ -46,8 +46,7 @@
 void disp_inten(double *buf, int size);
 void disp_bars(double *buf, int size);
 
-static const char usage[] = "\
-Usage: ddisp [-v -b -p -c -H] [width (512)] < inputfile\n";
+static const char usage[] = "Usage: ddisp [-v -b -p -c -H] [width (512)] < 
inputfile\n";
 
 int
 main(int argc, char **argv)

Modified: brlcad/trunk/src/sig/dfft.c
===================================================================
--- brlcad/trunk/src/sig/dfft.c 2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/sig/dfft.c 2013-08-05 15:35:41 UTC (rev 56582)
@@ -57,24 +57,27 @@
 void rfft(double *dat, int N);
 void LintoLog(double *in, double *out, int num);
 
-static const char usage[] = "\
-Usage: dfft [options] [width (1024)] < doubles > 512logmags\n\
-  Options are:\n\
-  -d dB  minimum dB (default 120)\n\
-  -l     log frequency scale\n\
-  -c     critical band filter (3rd octave)\n\
-  -p     phase\n\
-  -N     normalized PSD to max magnitude\n\
-  -L     linear output (no dB mag)\n\
-  -A     ascii output\n\
-";
+static const char usage[] =
+  "Usage: dfft [options] [width (1024)] < doubles > 512logmags\n"
+  "\n"
+  "Options:\n"
+  "  -d dB  minimum dB (default 120)\n"
+  "  -l     log frequency scale\n"
+  "  -c     critical band filter (3rd octave)\n"
+  "  -p     phase\n"
+  "  -N     normalized PSD to max magnitude\n"
+  "  -L     linear output (no dB mag)\n"
+  "  -A     ascii output\n"
+  ;
 
+static const char optstring[] = "d:clpLANh?";
+
 int main(int argc, char **argv)
 {
     int i, n, c;
     int L = 1024;
 
-    while ((c = bu_getopt(argc, argv, "d:clpLANh?")) != -1) {
+    while ((c = bu_getopt(argc, argv, optstring)) != -1) {
        switch (c) {
            case 'd': mindB = -atof(bu_optarg); break;
            case 'c': cflag++; break;

Modified: brlcad/trunk/src/sig/dpeak.c
===================================================================
--- brlcad/trunk/src/sig/dpeak.c        2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/sig/dpeak.c        2013-08-05 15:35:41 UTC (rev 56582)
@@ -44,10 +44,9 @@
     double     value;
 } peaks[BSIZE];
 
-static const char usage[] = "\
-Usage: dpeak [window_size (512)] < doubles\n";
+static const char usage[] = "Usage: dpeak [window_size (512)] < doubles\n";
 
-void   dumpmax(void);
+void dumpmax(void);
 
 int main(int argc, char **argv)
 {

Modified: brlcad/trunk/src/sig/dwin.c
===================================================================
--- brlcad/trunk/src/sig/dwin.c 2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/sig/dwin.c 2013-08-05 15:35:41 UTC (rev 56582)
@@ -66,16 +66,17 @@
 void hamwin(double *data, int length);
 void coswin(double *data, int length, double percent);
 
-static const char usage[] = "\
-Usage: dwin [options] [width (1024)] [step (width)] [start] <inputfile 
>outputfile\n\
-  Options:\n\
-  -w  apply window (80%% split Cosine)\n\
-  -H  apply Hamming window\n\
-  -b  apply Bartlett window (triangle)\n\
-  -B  apply bias window (half triangle)\n\
-  -e  start first sample at end of buffer\n\
-  -m  start first sample at middle of buffer\n\
-";
+static const char usage[] =
+  "Usage: dwin [options] [width (1024)] [step (width)] [start] <inputfile 
>outputfile\n"
+  "\n"
+  "Options:\n"
+  "  -w  apply window (80% split Cosine)\n"
+  "  -H  apply Hamming window\n"
+  "  -b  apply Bartlett window (triangle)\n"
+  "  -B  apply bias window (half triangle)\n"
+  "  -e  start first sample at end of buffer\n"
+  "  -m  start first sample at middle of buffer\n"
+  ;
 
 int main(int argc, char **argv)
 {

Modified: brlcad/trunk/src/sig/ihist.c
===================================================================
--- brlcad/trunk/src/sig/ihist.c        2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/sig/ihist.c        2013-08-05 15:35:41 UTC (rev 56582)
@@ -38,8 +38,7 @@
 
 int verbose = 0;
 
-static const char usage[] = "\
-Usage: ihist [-v] < shorts\n";
+static const char usage[] = "Usage: ihist [-v] < shorts\n";
 
 int main(int argc, char **argv)
 {

Modified: brlcad/trunk/src/util/fix_polysolids.c
===================================================================
--- brlcad/trunk/src/util/fix_polysolids.c      2013-08-05 14:53:20 UTC (rev 
56581)
+++ brlcad/trunk/src/util/fix_polysolids.c      2013-08-05 15:35:41 UTC (rev 
56582)
@@ -37,7 +37,17 @@
 #include "bn.h"
 #include "bu.h"
 
+static const char usage[] =
+  "Usage: %s [-v] [-xX DEBUG_FLAG] < brlcad_db.g > new_db.g\n"
+  "\n"
+  "Options:\n"
+  "  v - verbose\n"
+  "  x - librt debug flag\n"
+  "  X - nmg debug flag\n"
+  ;
 
+static char optstring[] = "vx:X:h?";
+
 /*
  * M A I N
  */
@@ -47,11 +57,6 @@
     static int verbose;
     static struct bn_tol tol;
 
-    static const char usage[] = "Usage: %s [-v] [-xX lvl] < brlcad_db.g > new 
db.g\n\
-       options:\n\
-               v - verbose\n\
-               x - librt debug flag\n\
-               X - nmg debug flag\n";
 
     union record rec;
     int c;
@@ -74,7 +79,7 @@
     BU_LIST_INIT(&RTG.rtg_vlfree);     /* for vlist macros */
 
     /* Get command line arguments. */
-    while ((c = bu_getopt(argc, argv, "vx:X:h?")) != -1) {
+    while ((c = bu_getopt(argc, argv, optstring)) != -1) {
        switch (c) {
            unsigned int debug;
            case 'v':

Modified: brlcad/trunk/src/util/pixcount.c
===================================================================
--- brlcad/trunk/src/util/pixcount.c    2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/util/pixcount.c    2013-08-05 15:35:41 UTC (rev 56582)
@@ -47,12 +47,9 @@
 int pixel_size = 3;            /* Bytes/pixel */
 FILE *outfp = NULL;            /* output file */
 
-static const char usage[] = "\
-Usage: 'pixcount [-# bytes_per_pixel]\n\
-                [infile.pix [outfile]]'\n";
-#define OPT_STRING "#:?"
+static const char usage[]     = "Usage: pixcount [-# bytes_per_pixel] 
[infile.pix [outfile]]\n";
+static const char optstring[] = "#:?";
 
-
 static void print_usage (void)
 {
     bu_exit(1, "%s", usage);
@@ -184,7 +181,7 @@
     /*
      * Process the command line
      */
-    while ((ch = bu_getopt(argc, argv, OPT_STRING)) != -1)
+    while ((ch = bu_getopt(argc, argv, optstring)) != -1)
        switch (ch) {
            case '#':
                if (sscanf(bu_optarg, "%d", &pixel_size) != 1) {

Modified: brlcad/trunk/src/util/plot3stat.c
===================================================================
--- brlcad/trunk/src/util/plot3stat.c   2013-08-05 14:53:20 UTC (rev 56581)
+++ brlcad/trunk/src/util/plot3stat.c   2013-08-05 15:35:41 UTC (rev 56582)
@@ -117,10 +117,8 @@
 void outshort(int n);
 void outfloat(int n);
 
-static const char usage[] = "\
-Usage: plot3stat [-v] [unix_plot]\n";
+static const char usage[] = "Usage: plot3stat [-v] [unix_plot]\n";
 
-
 int
 getshort(void)
 {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to