Revision: 55284
          http://sourceforge.net/p/brlcad/code/55284
Author:   carlmoore
Date:     2013-05-01 19:32:31 +0000 (Wed, 01 May 2013)
Log Message:
-----------
try to implement no-argument situation

Modified Paths:
--------------
    brlcad/trunk/src/conv/nmg/asc-nmg.c

Modified: brlcad/trunk/src/conv/nmg/asc-nmg.c
===================================================================
--- brlcad/trunk/src/conv/nmg/asc-nmg.c 2013-05-01 19:31:12 UTC (rev 55283)
+++ brlcad/trunk/src/conv/nmg/asc-nmg.c 2013-05-01 19:32:31 UTC (rev 55284)
@@ -43,7 +43,7 @@
 static int ascii_to_brlcad(FILE *fpin, struct rt_wdb *fpout, char *reg_name, 
char *grp_name);
 static void descr_to_nmg(struct shell *s, FILE *fp, fastf_t *Ext);
 
-char           usage[] = "Usage: %s [file]\n";
+char           usage[] = "Usage: asc-nmg [filein] [fileout] ; use - for 
stdin\n";
 
 /*
  *     M a i n
@@ -57,15 +57,19 @@
     FILE               *fpin;
     struct rt_wdb      *fpout;
 
+    if (isatty(fileno(stdin)) && isatty(fileno(stdout)) && argc == 1)
+       bu_log("%s       Program continues running:\n",usage);
+
     bu_setprogname(argv[0]);
 
     /* Get ascii NMG input file name. */
-    if (bu_optind >= argc) {
+    if (bu_optind >= argc || (int)(*argv[1]) == '-') {
        afile = "-";
        fpin = stdin;
 #if defined(_WIN32) && !defined(__CYGWIN__)
        setmode(fileno(fpin), O_BINARY);
 #endif
+    bu_log("%s: will be reading from stdin\n",argv[0]);
     } else {
        afile = argv[bu_optind];
        if ((fpin = fopen(afile, "rb")) == NULL) {
@@ -74,6 +78,7 @@
                    argv[0], afile);
            bu_exit(1, NULL);
        }
+    bu_log("%s: will be reading from file %s\n",argv[0],afile);
     }
 
 
@@ -89,6 +94,7 @@
                argv[0], bfile);
        bu_exit(1, NULL);
     }
+    bu_log("%s: will be creating file %s\n",argv[0],bfile);
 
     ascii_to_brlcad(fpin, fpout, "nmg", NULL);
     fclose(fpin);

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


------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to