Revision: 55606
          http://sourceforge.net/p/brlcad/code/55606
Author:   carlmoore
Date:     2013-05-30 18:26:23 +0000 (Thu, 30 May 2013)
Log Message:
-----------
simplify handling of h and ? for help; old h becomes H (argument for helix 
angle)

Modified Paths:
--------------
    brlcad/trunk/src/shapes/coil.c

Modified: brlcad/trunk/src/shapes/coil.c
===================================================================
--- brlcad/trunk/src/shapes/coil.c      2013-05-30 16:56:26 UTC (rev 55605)
+++ brlcad/trunk/src/shapes/coil.c      2013-05-30 18:26:23 UTC (rev 55606)
@@ -315,7 +315,7 @@
 
 void usage()
 {
-    bu_log("Usage: coil [-d mean_outer_diameter] [-w wire_diameter] [-h 
helix_angle] [-p pitch]\n");
+    bu_log("Usage: coil [-d mean_outer_diameter] [-w wire_diameter] [-H 
helix_angle] [-p pitch]\n");
     bu_log("            [-n number_of_turns] [-s start_cap_type] [-e 
end_cap_type]\n");
     bu_log("            [-S coil_data_structure] [-l overall_length] [-L]\n");
 }
@@ -326,7 +326,7 @@
 ReadArgs(int argc, char **argv, struct bu_list *sections, fastf_t 
*mean_outer_diameter, fastf_t *wire_diameter, fastf_t *helix_angle, fastf_t 
*pitch, int *nt, int *start_cap_type, int *end_cap_type, fastf_t 
*overall_length, int *lhf)
 {
     int c = 0;
-    char *options="d:w:h:p:n:s:e:S:l:L";
+    char *options="d:w:H:p:n:s:e:S:l:Lh?";
     int numturns, stype, etype, lhflag;
     float mean_od, wired, h_angle, ptch, lngth;
     int d1, d6;
@@ -335,8 +335,6 @@
 
     struct coil_data_t *coil_data;
 
-    bu_opterr = 0;
-
     if (argc == 1) {
        usage();
        bu_log("       Program continues running:\n");
@@ -352,7 +350,7 @@
                sscanf(bu_optarg, "%f", &wired);
                *wire_diameter = wired;
                break;
-           case 'h':
+           case 'H':
                sscanf(bu_optarg, "%f", &h_angle);
                *helix_angle = h_angle;
                break;
@@ -395,17 +393,7 @@
                }
                BU_LIST_INSERT(&(*sections), &((*coil_data).l));
                break;
-           case '?':
-               if (argc == 2)
-                   usedefaults=1;
-               usage();
-               break;
            default:
-               /* since c (bu_getopt() return value) holds '?',
-                * instead print bu_optopt global which holds the
-                * parsed character.
-                */
-               bu_log("%s: illegal option -- %c\n", bu_getprogname(), 
bu_optopt);
                usage();
                bu_exit(EXIT_FAILURE, NULL);
        }

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

Reply via email to