Mercurial > hg > octave-lyh
diff scripts/help/help.m @ 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 | ae42d5a67ed9 |
children | 049e8bbff782 |
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))