Revision: 55621
          http://sourceforge.net/p/brlcad/code/55621
Author:   carlmoore
Date:     2013-05-31 21:17:06 +0000 (Fri, 31 May 2013)
Log Message:
-----------
improve the Usage message, and implement -h and -?

Modified Paths:
--------------
    brlcad/trunk/src/sig/dsel.c

Modified: brlcad/trunk/src/sig/dsel.c
===================================================================
--- brlcad/trunk/src/sig/dsel.c 2013-05-31 20:42:10 UTC (rev 55620)
+++ brlcad/trunk/src/sig/dsel.c 2013-05-31 21:17:06 UTC (rev 55621)
@@ -33,6 +33,7 @@
 
 #define INTEGER_MAX ( ((int) ~0) >> 1 )
 
+static char usage[]="Usage: dsel keep ...\n       or\n       dsel skip keep 
...\n\n(must use <inputfile >outputfile)\n";
 
 double buf[4096] = {0};
 
@@ -72,9 +73,10 @@
     int        nskip;  /* number to skip */
     int        nkeep;  /* number to keep */
 
-    if ( argc < 1 || isatty(fileno(stdin)) || isatty(fileno(stdout)) ) {
-       bu_exit(1, "Usage: dsel num\n       dsel skip keep ...\n");
-    }
+    if ( isatty(fileno(stdin)) || isatty(fileno(stdout)) )
+       bu_exit(1, "%s",usage);
+    if ( BU_STR_EQUAL( argv[1], "-h" ) || BU_STR_EQUAL( argv[1], "-?" ) )
+       bu_exit(1, "%s",usage);
 
     if ( argc == 2 ) {
        keep( atoi(argv[1]) );

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


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to