Revision: 55722
http://sourceforge.net/p/brlcad/code/55722
Author: carlmoore
Date: 2013-06-12 16:41:35 +0000 (Wed, 12 Jun 2013)
Log Message:
-----------
change old h to H (do not see other alternate), and use h and ? for help; never
mind 'DEPRECATED' message, which didn't print during my testing; also, got rid
of core dump
Modified Paths:
--------------
brlcad/trunk/src/fb/fb-orle.c
Modified: brlcad/trunk/src/fb/fb-orle.c
===================================================================
--- brlcad/trunk/src/fb/fb-orle.c 2013-06-12 16:38:13 UTC (rev 55721)
+++ brlcad/trunk/src/fb/fb-orle.c 2013-06-12 16:41:35 UTC (rev 55722)
@@ -38,16 +38,6 @@
#include "fb.h"
#include "orle.h"
-static char *usage[] = {
- "Usage: fb-rle [-CScdhvw] [-l X Y] [-F Frame_buffer] [-p X Y] [file.rle]",
- "",
- "If no RLE file is specified, fb-rle will write to its standard output.",
- "If the environment variable FB_FILE is set, its value will be used to",
- "specify the framebuffer file or device to read from.",
- 0
-};
-
-
static FBIO *fbp;
static FILE *fp;
static RGBpixel bgpixel;
@@ -167,8 +157,11 @@
{
int c;
+ if (isatty(fileno(stdin)) && isatty(fileno(stdout)) && argc == 1)
+ return 0;
+
/* Parse options. */
- while ((c = bu_getopt(argc, argv, "CF:Scdhl:p:vw")) != -1) {
+ while ((c = bu_getopt(argc, argv, "CF:ScdHl:p:vwh?")) != -1) {
switch (c) {
case 'C' : /* Crunch color map. */
crunch = 1;
@@ -183,7 +176,7 @@
case 'd' : /* For debugging. */
rle_debug = 1;
break;
- case 'h' : /* High resolution. */
+ case 'H' : /* High resolution. */
width = 1024;
break;
case 'l' : /* Length in x and y. */
@@ -214,7 +207,7 @@
break;
case 'F' : fb_file = bu_optarg;
break;
- case '?' :
+ default :
return 0;
}
}
@@ -235,8 +228,7 @@
(void) fprintf(stderr, "Too many arguments!\n");
return 0;
}
- if (isatty(fileno(fp)))
- return 0;
+
if (xlen == 0)
xlen = width;
if (ylen == 0)
@@ -244,22 +236,18 @@
return 1;
}
-
/* p r n t U s a g e ()
Print usage message.
*/
static void
prntUsage(void)
{
- char **p = usage;
-
- while (*p) {
- (void) fprintf(stderr, "%s\n", *p++);
- }
- return;
+ fprintf(stderr, "Usage: fb-orle [-CScdHvw] [-l X Y] [-F Frame_buffer]
[-p X Y] [file.rle]\n\n");
+ fprintf(stderr, "If no RLE file is specified, fb-orle will write to its
standard output.\n");
+ fprintf(stderr, "If the environment variable FB_FILE is set, its value
will be used.\n");
}
+
-
/*
* Local Variables:
* mode: C
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