diff scripts/help/help.m @ 22227:ab139f0733b9

Document that "help OPERATOR" needs quotes around OPERATOR (bug #39349). * help.m (help, do_list_operators): State that quotes are required. * comma.m, paren.m, semicolon.m: Move do deprecated/ directory from help directory. * scripts/deprecated/module.mk: Add comma.m, paren.m, semicolon.m to deprecated directory. * scripts/help/module.mk: Remove comma.m, paren.m, semicolon.m from help directory.
author Lachlan Andrew <lachlanbis@gmail.com>
date Sun, 12 Jun 2016 19:38:22 +1000
parents ffad2baa90f7
children bac0d6f07a3e
line wrap: on
line diff
--- a/scripts/help/help.m	Thu Jun 30 18:30:26 2016 +1000
+++ b/scripts/help/help.m	Sun Jun 12 19:38:22 2016 +1000
@@ -33,13 +33,13 @@
 ## Given the single argument @code{.}, list all operators available in the
 ## current session of Octave.
 ##
-## If invoked without any arguments, @code{help} display instructions on how to
-## access help from the command line.
+## If invoked without any arguments, @code{help} displays instructions on how
+## to access help from the command line.
 ##
-## The help command can provide information about most operators, for example
-## @code{help +}, but not the comma and semicolon characters which are used
-## by the Octave interpreter as command separators.  For help on either of
-## these type @kbd{help comma} or @kbd{help semicolon}.
+## The help command can provide information about most operators, but
+## @var{name} must be enclosed by single or double quotes to prevent
+## the Octave interpreter from acting on @var{name}.  For example,
+## @code{help "+"} displays help on the addition operator.
 ## @seealso{doc, lookfor, which, info}
 ## @end deftypefn
 
@@ -53,10 +53,10 @@
     help NAME\n\
 \n\
   (replace NAME with the name of the command or function you would\n\
-  like to learn more about).\n\
+  like to learn more about; for an operator, enclose NAME in quotes).\n\
 \n\
-  For a more detailed introduction to GNU Octave, please consult the\n\
-  manual.  To read the manual from the prompt type\n\
+  For a more detailed introduction to GNU Octave, consult the manual.\n\
+  The manual may be read from the prompt by typing\n\
 \n\
     doc\n\
 \n\
@@ -130,8 +130,10 @@
 endfunction
 
 function retval = do_list_operators ()
-  retval = sprintf ("*** operators:\n\n%s\n\n",
-                    list_in_columns (__operators__ ()));
+  retval = sprintf ("*** operators:\n\n%s\n%s\n\n",
+                    list_in_columns (__operators__ ()),
+                    ["To obtain help on an operator, type\n"...
+                     "      help \"NAME\"   or   help 'NAME'"]);
 endfunction
 
 function retval = do_list_functions ()