diff scripts/plot/print.m @ 6870:e2e5425905ac

[project @ 2007-09-06 20:18:20 by jwe]
author jwe
date Thu, 06 Sep 2007 20:18:28 +0000
parents db0a05a61d09
children bdbe9778d995
line wrap: on
line diff
--- a/scripts/plot/print.m	Thu Sep 06 16:38:44 2007 +0000
+++ b/scripts/plot/print.m	Thu Sep 06 20:18:28 2007 +0000
@@ -119,6 +119,8 @@
   name = "";
   devopt = "";
   printer = "";
+  debug = false;
+  debug_file = "octave-print-commands.log"
 
   for i = 1:nargin
     arg = varargin{i};
@@ -135,8 +137,13 @@
 	orientation = "portrait";
       elseif (strcmp (arg, "-landscape"))
 	orientation = "landscape";
+      elseif (strncmp (arg, "-debug", 6))
+	debug = true;
+	if (length (arg) > 7)
+	  debug_file = arg(7:end);
+	endif
       elseif (length (arg) > 2 && arg(1:2) == "-d")
-	devopt = arg(3:length(arg));
+	devopt = arg(3:end);
       elseif (length (arg) > 2 && arg(1:2) == "-P")
 	printer = arg;
       elseif (length (arg) > 2 && arg(1:2) == "-F")
@@ -332,7 +339,11 @@
     new_terminal = dev;
   endif
 
-  drawnow (new_terminal, name);
+  if (debug)
+    drawnow (new_terminal, name, debug_file);
+  else
+    drawnow (new_terminal, name);
+  endif
 
   if (! isempty (convertname))
     command = sprintf ("convert '%s' '%s'", name, convertname);