Revision: 55712
http://sourceforge.net/p/brlcad/code/55712
Author: carlmoore
Date: 2013-06-11 21:01:22 +0000 (Tue, 11 Jun 2013)
Log Message:
-----------
implement -h and -? for help (old -h has become -H)
Modified Paths:
--------------
brlcad/trunk/src/fb/fb-cmap.c
Modified: brlcad/trunk/src/fb/fb-cmap.c
===================================================================
--- brlcad/trunk/src/fb/fb-cmap.c 2013-06-11 20:42:20 UTC (rev 55711)
+++ brlcad/trunk/src/fb/fb-cmap.c 2013-06-11 21:01:22 UTC (rev 55712)
@@ -35,7 +35,7 @@
ColorMap cm;
static char usage[] = "\
-Usage: fb-cmap [-h] [colormap]\n";
+Usage: fb-cmap [-H] [colormap]\n";
int
main(int argc, char **argv)
@@ -46,10 +46,11 @@
int i;
while (argc > 1) {
- if (BU_STR_EQUAL(argv[1], "-h")) {
+ if (BU_STR_EQUAL(argv[1], "-H")) {
fbsize = 1024;
} else if (argv[1][0] == '-') {
- /* unknown flag */
+ if ( (!BU_STR_EQUAL(argv[1], "-?")) && (!BU_STR_EQUAL(argv[1],
"-h")) )
+ fprintf(stderr, "fb-cmap: unknown flag %s\n", argv[1]);
bu_exit(1, "%s", usage);
} else
break; /* must be a filename */
@@ -62,8 +63,11 @@
fprintf(stderr, "fb-cmap: can't open \"%s\"\n", argv[1]);
bu_exit(2, "%s", usage);
}
- } else
+ } else {
fp = stdout;
+ if(isatty(fileno(fp)))
+ fprintf(stderr, "%s Program continues running:\n", usage);
+ }
if ((fbp = fb_open(NULL, fbsize, fbsize)) == FBIO_NULL)
bu_exit(2, "Unable to open framebuffer\n");
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