Mercurial > hg > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
15226:a0af93de0ba3 | 15227:fbecbce45898 |
---|---|
42 | 42 |
43 function retval = help (name) | 43 function retval = help (name) |
44 | 44 |
45 if (nargin == 0) | 45 if (nargin == 0) |
46 | 46 |
47 puts ("\n\ | 47 text = "\n\ |
48 For help with individual commands and functions type\n\ | 48 For help with individual commands and functions type\n\ |
49 \n\ | 49 \n\ |
50 help NAME\n\ | 50 help NAME\n\ |
51 \n\ | 51 \n\ |
52 (replace NAME with the name of the command or function you would\n\ | 52 (replace NAME with the name of the command or function you would\n\ |
56 manual. To read the manual from the prompt type\n\ | 56 manual. To read the manual from the prompt type\n\ |
57 \n\ | 57 \n\ |
58 doc\n\ | 58 doc\n\ |
59 \n\ | 59 \n\ |
60 GNU Octave is supported and developed by its user community.\n\ | 60 GNU Octave is supported and developed by its user community.\n\ |
61 For more information visit http://www.octave.org.\n\n"); | 61 For more information visit http://www.octave.org.\n\n"; |
62 | |
63 if (nargout == 0) | |
64 puts (text); | |
65 else | |
66 retval = text; | |
67 endif | |
62 | 68 |
63 elseif (nargin == 1 && ischar (name)) | 69 elseif (nargin == 1 && ischar (name)) |
64 | 70 |
65 if (strcmp (name, "--list")) | 71 if (strcmp (name, "--list")) |
66 tmp = do_list_functions (); | 72 tmp = do_list_functions (); |