Revision: 55641
http://sourceforge.net/p/brlcad/code/55641
Author: carlmoore
Date: 2013-06-03 19:06:59 +0000 (Mon, 03 Jun 2013)
Log Message:
-----------
clean up the handling of h and ? as help
Modified Paths:
--------------
brlcad/trunk/src/util/dsp_add.c
Modified: brlcad/trunk/src/util/dsp_add.c
===================================================================
--- brlcad/trunk/src/util/dsp_add.c 2013-06-03 18:10:12 UTC (rev 55640)
+++ brlcad/trunk/src/util/dsp_add.c 2013-06-03 19:06:59 UTC (rev 55641)
@@ -37,7 +37,7 @@
/* declarations to support use of bu_getopt() system call */
-char *options = "h";
+char *options = "h?";
char *progname = "(noname)";
#define ADD_STYLE_INT 0
@@ -51,8 +51,8 @@
{
if (s) (void)fputs(s, stderr);
- (void) fprintf(stderr, "Usage: %s [ -%s ] dsp_1 dsp_2 > dsp_3\n",
- progname, options);
+ (void) fprintf(stderr, "Usage: %s dsp_1 dsp_2 > dsp_3\n",
+ progname);
bu_exit (1, NULL);
}
@@ -70,15 +70,11 @@
else
++progname;
- /* Turn off bu_getopt's error messages */
- bu_opterr = 0;
-
/* get all the option flags from the command line */
while ((c=bu_getopt(ac, av, options)) != -1)
switch (c) {
- case '?' :
- case 'h' :
- default : usage("Bad or help flag specified\n"); break;
+ default:
+ usage("");
}
return bu_optind;
@@ -181,10 +177,10 @@
struct stat sb;
size_t ret;
+ if (isatty(fileno(stdout))) usage("Must redirect standard output\n");
+
next_arg = parse_args(ac, av);
- if (isatty(fileno(stdout))) usage("Redirect standard output\n");
-
if (next_arg >= ac) usage("No files specified\n");
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits