Revision: 55701
          http://sourceforge.net/p/brlcad/code/55701
Author:   carlmoore
Date:     2013-06-10 18:03:20 +0000 (Mon, 10 Jun 2013)
Log Message:
-----------
remove old -h (high-res); use h,?,run-with-no-arguments for help

Modified Paths:
--------------
    brlcad/trunk/src/util/pixscale.c
    brlcad/trunk/src/util/pixshrink.c

Modified: brlcad/trunk/src/util/pixscale.c
===================================================================
--- brlcad/trunk/src/util/pixscale.c    2013-06-10 17:47:20 UTC (rev 55700)
+++ brlcad/trunk/src/util/pixscale.c    2013-06-10 18:03:20 UTC (rev 55701)
@@ -61,7 +61,7 @@
 
 
 static char usage[] = "\
-Usage: pixscale [-h] [-r] [-s squareinsize] [-w inwidth] [-n inheight]\n\
+Usage: pixscale [-r] [-s squareinsize] [-w inwidth] [-n inheight]\n\
        [-S squareoutsize] [-W outwidth] [-N outheight] [in.pix] > out.pix\n";
 
 /****** THIS PROBABLY SHOULD BE ELSEWHERE *******/
@@ -339,16 +339,12 @@
 {
     int c;
 
-    while ((c = bu_getopt(argc, argv, "rhs:w:n:S:W:N:")) != -1) {
+    while ((c = bu_getopt(argc, argv, "rs:w:n:S:W:N:h?")) != -1) {
        switch (c) {
            case 'r':
                /* pixel replication */
                rflag = 1;
                break;
-           case 'h':
-               /* high-res */
-               inx = iny = 1024;
-               break;
            case 'S':
                /* square size */
                outx = outy = atoi(bu_optarg);
@@ -413,9 +409,10 @@
 {
     int i;
 
-    if (!get_args(argc, argv) || isatty(fileno(stdout))) {
+    if ( argc == 1 && isatty(fileno(stdin)) && isatty(fileno(stdout)) )
        bu_exit(1, "%s", usage);
-    }
+    if (!get_args(argc, argv) || isatty(fileno(stdout)))
+       bu_exit(1, "%s", usage);
 
     if (inx <= 0 || iny <= 0 || outx <= 0 || outy <= 0) {
        bu_exit(2, "pixscale: bad size\n");

Modified: brlcad/trunk/src/util/pixshrink.c
===================================================================
--- brlcad/trunk/src/util/pixshrink.c   2013-06-10 17:47:20 UTC (rev 55700)
+++ brlcad/trunk/src/util/pixshrink.c   2013-06-10 18:03:20 UTC (rev 55701)
@@ -35,7 +35,7 @@
 #define UCHAR unsigned char
 
 /* declarations to support use of bu_getopt() system call */
-char *options = "uhs:w:n:f:";
+char *options = "us:w:n:f:h?";
 
 char *progname = "(noname)";
 char *filename = "(stdin)";
@@ -173,7 +173,7 @@
 void usage(void)
 {
     (void) fprintf(stderr,
-                  "Usage: %s [-u] [-h] [-w width] [-n scanlines] [-s 
squaresize]\n\
+                  "Usage: %s [-u] [-w width] [-n scanlines] [-s squaresize]\n\
                 [-f shrink_factor] [pixfile] > pixfile\n", progname);
     bu_exit (1, NULL);
 }
@@ -182,16 +182,14 @@
 /*
  * P A R S E _ A R G S --- Parse through command line flags
  */
-void parse_args(int ac, char **av)
+void
+parse_args(int ac, char **av)
 {
     int c;
 
     if (!(progname = strrchr(*av, '/')))
        progname = *av;
 
-    /* Turn off bu_getopt's error messages */
-    bu_opterr = 0;
-
     /* get all the option flags from the command line */
     while ((c=bu_getopt(ac, av, options)) != -1)
        switch (c) {
@@ -199,9 +197,6 @@
                if ((c = atoi(bu_optarg)) > 1)
                    factor = c;
                break;
-           case 'h':
-               width = height = 1024;
-               break;
            case 'n':
                if ((c=atoi(bu_optarg)) > 0)
                    height = c;
@@ -217,7 +212,6 @@
            case 'u':
                method = METH_UNDERSAMPLE;
                break;
-           case '?':
            default:
                usage();
                break;
@@ -254,7 +248,8 @@
     UCHAR *buffer = (UCHAR *)NULL;
 
     (void)parse_args(ac, av);
-    if (isatty(fileno(stdin))) usage();
+    if (isatty(fileno(stdin)))
+       usage();
 
     /* process stdin */
     scanlen = width * 3;

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