Revision: 55295
http://sourceforge.net/p/brlcad/code/55295
Author: carlmoore
Date: 2013-05-02 18:13:41 +0000 (Thu, 02 May 2013)
Log Message:
-----------
define 'usage' and also allow for -h and -?
Modified Paths:
--------------
brlcad/trunk/src/sig/dmod.c
Modified: brlcad/trunk/src/sig/dmod.c
===================================================================
--- brlcad/trunk/src/sig/dmod.c 2013-05-02 17:21:50 UTC (rev 55294)
+++ brlcad/trunk/src/sig/dmod.c 2013-05-02 18:13:41 UTC (rev 55295)
@@ -53,13 +53,15 @@
double val[256] = {0.0}; /* arguments to operations */
double buf[BUFLEN] = {0.0}; /* working buffer */
+static const char usage[] = "Usage: dmod {-a add -s sub -m mult -d div -A(abs)
-e exp -r root} [doubles]\n";
+
int
get_args(int argc, char **argv)
{
int c;
double d;
- while ( (c = bu_getopt( argc, argv, "a:s:m:d:Ae:r:" )) != -1 ) {
+ while ( (c = bu_getopt( argc, argv, "a:s:m:d:Ae:r:h?" )) != -1 ) {
switch ( c ) {
case 'a':
op[ numop ] = ADD;
@@ -99,7 +101,7 @@
break;
default: /* '?' */
- return 0;
+ bu_exit(1, "%s", usage);
}
}
@@ -134,7 +136,7 @@
if ( !get_args( argc, argv ) || isatty(fileno(infp))
|| isatty(fileno(stdout)) ) {
- bu_exit(1, "Usage: dmod {-a add -s sub -m mult -d div -A(abs) -e exp -r
root} [doubles]\n");
+ bu_exit(1, "%s", usage);
}
while ( (n = fread(buf, sizeof(*buf), BUFLEN, infp)) > 0 ) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits