Revision: 55754
          http://sourceforge.net/p/brlcad/code/55754
Author:   carlmoore
Date:     2013-06-13 17:02:11 +0000 (Thu, 13 Jun 2013)
Log Message:
-----------
implement h,?,run-with-no-arguments help; remove old h

Modified Paths:
--------------
    brlcad/trunk/src/fb/fbcmap.c

Modified: brlcad/trunk/src/fb/fbcmap.c
===================================================================
--- brlcad/trunk/src/fb/fbcmap.c        2013-06-13 16:52:56 UTC (rev 55753)
+++ brlcad/trunk/src/fb/fbcmap.c        2013-06-13 17:02:11 UTC (rev 55754)
@@ -591,11 +591,8 @@
 {
     int c;
 
-    while ((c = bu_getopt(argc, argv, "hF:s:S:w:W:n:N:")) != -1) {
+    while ((c = bu_getopt(argc, argv, "F:s:S:w:W:n:N:h?")) != -1) {
        switch (c) {
-           case 'h' :
-               scr_width = scr_height = 1024;
-               break;
            case 'F':
                framebuffer = bu_optarg;
                break;
@@ -612,7 +609,7 @@
            case 'N':
                scr_height = atoi(bu_optarg);
                break;
-           case '?' :
+           default :
                return 0;
        }
     }
@@ -625,7 +622,7 @@
 static void
 usage()
 {
-    (void) fprintf(stderr, "Usage: fbcmap [-h] [-F framebuffer]\n");
+    (void) fprintf(stderr, "Usage: fbcmap [-F framebuffer]\n");
     (void) fprintf(stderr, "   [-{sS} squarescrsize] [-{wW} scr_width] [-{nN} 
scr_height]\n");
     (void) fprintf(stderr, "   [map_number]\n");
     (void) fprintf(stderr,
@@ -646,9 +643,9 @@
     (void) fprintf(stderr, "Color map #10, solid black.\n");
     (void) fprintf(stderr, "Color map #11, solid white.\n");
     (void) fprintf(stderr, "Color map #12, 18%% neutral grey.\n");
+    bu_exit(1, NULL);
 }
 
-
 int
 main(int argc, char **argv)
 {
@@ -658,10 +655,10 @@
     ColorMap *cp = &cmap;
     FBIO *fbp;
 
-    if (! pars_Argv(argc, argv)) {
+    if (argc == 1 && isatty(fileno(stdin)) && isatty(fileno(stdout)))
        usage();
-       return 1;
-    }
+    if (! pars_Argv(argc, argv))
+       usage();
 
     if ((fbp = fb_open(framebuffer, scr_width, scr_height)) == NULL)
        return 1;

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


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to