Mercurial > hg > octave-nkf
diff scripts/help/print_usage.m @ 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 | f3df413338c5 |
children | 30817aa3889a |
line wrap: on
line diff
--- a/scripts/help/print_usage.m +++ b/scripts/help/print_usage.m @@ -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"