Revision: 55732
          http://sourceforge.net/p/brlcad/code/55732
Author:   carlmoore
Date:     2013-06-12 20:38:05 +0000 (Wed, 12 Jun 2013)
Log Message:
-----------
insert missing 'e' in options in Usage; remove h (high-res); add h,? and 
run-with-no-arguments for help; 'sets mode to' inserted in 3 places to avoid 
the appearance of needed ARGUMENT

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

Modified: brlcad/trunk/src/fb/fbcbars.c
===================================================================
--- brlcad/trunk/src/fb/fbcbars.c       2013-06-12 19:42:51 UTC (rev 55731)
+++ brlcad/trunk/src/fb/fbcbars.c       2013-06-12 20:38:05 UTC (rev 55732)
@@ -154,11 +154,11 @@
 
 
 static char usage[] = "\
-Usage: fbcbars [-fs] [-h] [-F framebuffer]\n\
+Usage: fbcbars [-fes] [-F framebuffer]\n\
        [-S squarescrsize] [-W scr_width] [-N scr_height]\n\
-       -f      FCC/EBU bars\n\
-       -e      EIA bars\n\
-       -s      SMPTE bars\n";
+       -f      sets mode to FCC/EBU bars\n\
+       -e      sets mode to EIA bars\n\
+       -s      sets mode to SMPTE bars\n";
 
 #define M_EIA 0
 #define M_FCC 1
@@ -170,7 +170,7 @@
 {
     int c;
 
-    while ((c = bu_getopt(argc, argv, "efshF:S:W:N:")) != -1) {
+    while ((c = bu_getopt(argc, argv, "efsF:S:W:N:h?")) != -1) {
        switch (c) {
            case 'e':
                mode = M_EIA;
@@ -181,10 +181,6 @@
            case 'f':
                mode = M_FCC;
                break;
-           case 'h':
-               /* high-res */
-               scr_height = scr_width = 1024;
-               break;
            case 'F':
                framebuffer = bu_optarg;
                break;
@@ -209,6 +205,11 @@
     return 1;          /* OK */
 }
 
+void
+printusage(void) {
+       (void)fputs(usage, stderr);
+       bu_exit(1, NULL);
+}
 
 int
 main(int argc, char **argv)
@@ -216,10 +217,10 @@
     int x, y;
     FBIO *fbp;
 
-    if (!get_args(argc, argv)) {
-       (void)fputs(usage, stderr);
-       bu_exit(1, NULL);
-    }
+    if (argc == 1 && isatty(fileno(stdin)) && isatty(fileno(stdout)))
+       printusage();
+    if (!get_args(argc, argv))
+       printusage();
 
     if ((fbp = fb_open(framebuffer, scr_width, scr_height)) == NULL)
        bu_exit(12, NULL);

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