changeset 9535:936734e15a4d

print_usage: make it work again if an argument is given
author John W. Eaton <jwe@octave.org>
date Mon, 17 Aug 2009 14:53:48 -0400
parents baeecd69fd44
children 592a959b68e5
files scripts/ChangeLog scripts/help/print_usage.m
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon Aug 17 12:45:02 2009 -0400
+++ b/scripts/ChangeLog	Mon Aug 17 14:53:48 2009 -0400
@@ -1,3 +1,7 @@
+2009-08-17  John W. Eaton  <jwe@octave.org>
+
+	* help/print_usage.m: Make it work again if an argument is given.
+
 2009-08-17  Jaroslav Hajek  <highegg@gmail.com>
 
 	* help/print_usage: Allow calling from methods.
--- a/scripts/help/print_usage.m	Mon Aug 17 12:45:02 2009 -0400
+++ b/scripts/help/print_usage.m	Mon Aug 17 14:53:48 2009 -0400
@@ -33,18 +33,18 @@
     else
       error ("print_usage: invalid function\n");
     endif
-    path = evalin ("caller", "mfilename (""fullpath"")");
-    if (strcmp (path(end-length(name)+1:end), name))
-      path = [path, ".m"];
-    else
-      path = name;
+    fullpath = evalin ("caller", "mfilename (""fullpath"")");
+    if (strcmp (fullpath(end-length(name)+1:end), name))
+      fullname = [fullpath, ".m"];
     endif
   elseif (!ischar (name))
     error ("print_usage: input argument must be a string");
+  else
+    fullname = name;
   endif
   
   ## Do the actual work
-  [text, format] = get_help_text (path);
+  [text, format] = get_help_text (fullname);
   max_len = 80;
   switch (lower (format))
     case "plain text"