Revision: 55592
http://sourceforge.net/p/brlcad/code/55592
Author: carlmoore
Date: 2013-05-29 21:18:48 +0000 (Wed, 29 May 2013)
Log Message:
-----------
implement h and ? for 3 chan_* utilities
Modified Paths:
--------------
brlcad/trunk/src/anim/chan_add.c
brlcad/trunk/src/anim/chan_mult.c
brlcad/trunk/src/anim/chan_permute.c
Modified: brlcad/trunk/src/anim/chan_add.c
===================================================================
--- brlcad/trunk/src/anim/chan_add.c 2013-05-29 19:31:42 UTC (rev 55591)
+++ brlcad/trunk/src/anim/chan_add.c 2013-05-29 21:18:48 UTC (rev 55592)
@@ -31,6 +31,11 @@
#include "bio.h"
#include "bu.h"
+void
+printusage (void) {
+ fprintf(stderr, "Usage: chan_add value num_columns column [column ...]
< in.file > out.file\n");
+ bu_exit(-1, NULL);
+}
int
main(int argc, char **argv)
@@ -38,10 +43,10 @@
double addend, temp;
int i, j, doit, of, count, val, *col_list;
- if (argc < 4) {
- fprintf(stderr, "Usage: chan_add value num_columns column [column ...]
< in.file > out.file\n");
- return -1;
- }
+ if ( BU_STR_EQUAL(argv[1], "-h") || BU_STR_EQUAL(argv[1], "-?") )
+ printusage();
+ if (argc < 4)
+ printusage();
sscanf(*(argv+1), "%lf", &addend);
sscanf(*(argv+2), "%d", &of);
Modified: brlcad/trunk/src/anim/chan_mult.c
===================================================================
--- brlcad/trunk/src/anim/chan_mult.c 2013-05-29 19:31:42 UTC (rev 55591)
+++ brlcad/trunk/src/anim/chan_mult.c 2013-05-29 21:18:48 UTC (rev 55592)
@@ -31,6 +31,11 @@
#include "bio.h"
#include "bu.h"
+void
+printusage (void) {
+ fprintf(stderr, "Usage: chan_mult factor num_columns column [col ... ]
< in.file > out.file\n");
+ bu_exit(-1, NULL);
+}
int
main(int argc, char **argv)
@@ -38,10 +43,10 @@
double factor, temp;
int i, j, doit, of, count, val, *col_list;
- if (argc < 4) {
- fprintf(stderr, "Usage: chan_mult factor num_columns column [col ... ]
< in.file > out.file\n");
- return -1;
- }
+ if ( BU_STR_EQUAL(argv[1], "-h") || BU_STR_EQUAL(argv[1], "-?") )
+ printusage();
+ if (argc < 4)
+ printusage();
sscanf(*(argv+1), "%lf", &factor);
sscanf(*(argv+2), "%d", &of);
Modified: brlcad/trunk/src/anim/chan_permute.c
===================================================================
--- brlcad/trunk/src/anim/chan_permute.c 2013-05-29 19:31:42 UTC (rev
55591)
+++ brlcad/trunk/src/anim/chan_permute.c 2013-05-29 21:18:48 UTC (rev
55592)
@@ -62,6 +62,13 @@
char ihead[] = "-i";
char ohead[] = "-o";
+void
+printusage (void) {
+ fprintf(stderr,
+ "Usage: chan_permute -i infile1 id id id ... [-i infile2 ...]
-o outfile1 id id ... [-o outfile2 ...]\n");
+ bu_exit(-1, NULL);
+}
+
int
main(int argc, char *argv[])
{
@@ -70,11 +77,10 @@
struct unit *x, *y;
Word *arrayd;
- if (argc == 1) {
- fprintf(stderr,
- "Usage: chan_permute -i infile1 id id id ... [-i infile2 ...]
-o outfile1 id id ... [-o outfile2 ...]\n");
- bu_exit(-1, NULL);
- }
+ if ( BU_STR_EQUAL(argv[1], "-h") || BU_STR_EQUAL(argv[1], "-?") )
+ printusage();
+ if (argc == 1)
+ printusage();
i=j=icount = ocount = maxlength = 0;
for (i=1;i<argc;i++) {
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