Revision: 55696
http://sourceforge.net/p/brlcad/code/55696
Author: carlmoore
Date: 2013-06-07 20:29:26 +0000 (Fri, 07 Jun 2013)
Log Message:
-----------
implement -h and -? (removing old -h high-res)
Modified Paths:
--------------
brlcad/trunk/src/util/pix-ps.c
Modified: brlcad/trunk/src/util/pix-ps.c
===================================================================
--- brlcad/trunk/src/util/pix-ps.c 2013-06-07 19:32:30 UTC (rev 55695)
+++ brlcad/trunk/src/util/pix-ps.c 2013-06-07 20:29:26 UTC (rev 55696)
@@ -54,7 +54,7 @@
static char usage[] = "\
-Usage: pix-ps [-e] [-c|-l] [-L] [-h]\n\
+Usage: pix-ps [-e] [-c|-l] [-L]\n\
[-s input_squaresize] [-w input_width] [-n input_height]\n\
[-S inches_square] [-W inches_width] [-N inches_height] [file.pix]\n";
@@ -138,16 +138,12 @@
{
int c;
- while ((c = bu_getopt(argc, argv, "ehclLs:w:n:S:W:N:")) != -1) {
+ while ((c = bu_getopt(argc, argv, "eclLs:w:n:S:W:N:h?")) != -1) {
switch (c) {
case 'e':
/* Encapsulated PostScript */
encapsulated++;
break;
- case 'h':
- /* high-res */
- height = width = 1024;
- break;
case 'c':
center = 1;
break;
@@ -205,6 +201,12 @@
return 1; /* OK */
}
+void
+printusage(void)
+{
+ (void)fputs(usage, stderr);
+ bu_exit (1, NULL);
+}
int
main(int argc, char **argv)
@@ -214,13 +216,13 @@
size_t scans_per_patch, bytes_per_patch;
size_t y;
+ if (argc == 1 && isatty(fileno(stdin)) && isatty(fileno(stdout)) )
+ printusage();
+ if (!get_args(argc, argv))
+ printusage();
+
outwidth = outheight = DEFAULT_SIZE;
- if (!get_args(argc, argv)) {
- (void)fputs(usage, stderr);
- bu_exit (1, NULL);
- }
-
if (encapsulated) {
xpoints = width;
ypoints = height;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits