Mercurial > hg > octave-terminal
changeset 15227:fbecbce45898
also return help text as a string when nargin = 0 (bug #37183)
* help.m: Return help text if nargin == 0 && nargout != 0.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 24 Aug 2012 14:46:55 -0400 |
parents | a0af93de0ba3 |
children | 947cf10c94da e5a86de6023c |
files | scripts/help/help.m |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/help/help.m +++ b/scripts/help/help.m @@ -44,7 +44,7 @@ if (nargin == 0) - puts ("\n\ + text = "\n\ For help with individual commands and functions type\n\ \n\ help NAME\n\ @@ -58,7 +58,13 @@ doc\n\ \n\ GNU Octave is supported and developed by its user community.\n\ - For more information visit http://www.octave.org.\n\n"); + For more information visit http://www.octave.org.\n\n"; + + if (nargout == 0) + puts (text); + else + retval = text; + endif elseif (nargin == 1 && ischar (name))