Mercurial > octave-libgccjit
changeset 8631:52956d669506
Display sensible error message when the help text of an undocumented function is requested
author | Soren Hauberg <hauberg@gmail.com> |
---|---|
date | Sun, 25 Jan 2009 19:55:42 +0100 |
parents | 540165304f00 |
children | d366fdf4ffe9 |
files | scripts/ChangeLog scripts/help/get_first_help_sentence.m scripts/help/help.m scripts/help/print_usage.m src/ChangeLog src/help.cc |
diffstat | 6 files changed, 27 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog Sun Jan 25 17:25:15 2009 +0100 +++ b/scripts/ChangeLog Sun Jan 25 19:55:42 2009 +0100 @@ -92,6 +92,11 @@ 2009-01-25 Søren Hauberg <hauberg@gmail.com> + * help/help.m, help/print_usage.m, help/get_first_help_sentence.m: + print sensible error message when function is found but not documented. + +2009-01-25 Søren Hauberg <hauberg@gmail.com> + * help/help.m: Allow displaying 'Contents.m' files. 2009-01-23 Søren Hauberg <hauberg@gmail.com>
--- a/scripts/help/get_first_help_sentence.m Sun Jan 25 17:25:15 2009 +0100 +++ b/scripts/help/get_first_help_sentence.m Sun Jan 25 19:55:42 2009 +0100 @@ -61,6 +61,8 @@ [retval, status] = first_sentence_texinfo (help_text, max_len); case "html" [retval, status] = first_sentence_html (help_text, max_len); + case "not documented" + error ("get_first_help_sentence: `%s' is not documented\n", name); case "not found" error ("get_first_help_sentence: `%s' not found\n", name); otherwise
--- a/scripts/help/help.m Sun Jan 25 17:25:15 2009 +0100 +++ b/scripts/help/help.m Sun Jan 25 19:55:42 2009 +0100 @@ -60,6 +60,8 @@ [text, status] = makeinfo (text, "plain text"); case "html" [text, status] = strip_html_tags (text); + case "not documented" + error ("help: `%s' is not documented\n", name); case "not found" [text, status] = do_contents (name); if (status != 0)
--- a/scripts/help/print_usage.m Sun Jan 25 17:25:15 2009 +0100 +++ b/scripts/help/print_usage.m Sun Jan 25 19:55:42 2009 +0100 @@ -47,6 +47,8 @@ [usage_string, status] = get_usage_texinfo (text, max_len); case "html" [usage_string, status] = get_usage_html (text, max_len); + case "not documented" + error ("print_usage: `%s' is not documented\n", name); case "not found" error ("print_usage: `%s' not found\n", name); otherwise
--- a/src/ChangeLog Sun Jan 25 17:25:15 2009 +0100 +++ b/src/ChangeLog Sun Jan 25 19:55:42 2009 +0100 @@ -82,6 +82,11 @@ 2009-01-25 Søren Hauberg <hauberg@gmail.com> + * help.cc (do_get_help_text, raw_help_from_symbol_table): new output to + flag the a function is found but not documented. + +2009-01-25 Søren Hauberg <hauberg@gmail.com> + * help.cc (raw_help_from_file): No longer search for files called 'Contents.m', as this is moved to 'script/help.m'.
--- a/src/help.cc Sun Jan 25 17:25:15 2009 +0100 +++ b/src/help.cc Sun Jan 25 19:55:42 2009 +0100 @@ -633,16 +633,13 @@ h = fcn->doc_string (); - if (! h.empty ()) - { - retval = true; + retval = true; + + w = fcn->fcn_file_name (); - w = fcn->fcn_file_name (); - - if (w.empty ()) - w = fcn->is_user_function () - ? "command-line function" : "built-in function"; - } + if (w.empty ()) + w = fcn->is_user_function () + ? "command-line function" : "built-in function"; } } @@ -699,7 +696,11 @@ if (symbol_found) { size_t idx = -1; - if (looks_like_texinfo (text, idx)) + if (text.empty ()) + { + format = "Not documented"; + } + else if (looks_like_texinfo (text, idx)) { format = "texinfo"; text.erase (0, idx);