Mercurial > hg > octave-terminal
changeset 15559:6f3363ff368c
print_usage.m: Adding error identifiers.
author | Juan Pablo Carbajal (desktop) <ajuanpi+dev@gmail.com> |
---|---|
date | Tue, 23 Oct 2012 23:09:33 +0200 |
parents | 8e6a72cac999 |
children | 305ad0a215ba |
files | scripts/help/print_usage.m |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/help/print_usage.m +++ b/scripts/help/print_usage.m @@ -33,14 +33,15 @@ if (numel (x) > 1) name = x (2).name; else - error ("print_usage: invalid function\n"); + error ("Octave:invalid-context", "print_usage: invalid function\n"); endif fullpath = evalin ("caller", "mfilename (""fullpath"")"); if (strcmp (fullpath(end-length(name)+1:end), name)) fullname = [fullpath, ".m"]; endif elseif (!ischar (name)) - error ("print_usage: input argument must be a string"); + error ("Octave:invalid-input-arg", + "print_usage: input argument must be a string"); else fullname = name; endif @@ -73,7 +74,7 @@ endif if (at_toplev) - error ("Invalid call to %s. Correct usage is:\n\n%s\n%s", + error ("Octave:invalid-fun-call", "Invalid call to %s. Correct usage is:\n\n%s\n%s", name, usage_string, __additional_help_message__ ()); else msg = sprintf ("Invalid call to %s. Correct usage is:\n\n%s", @@ -84,7 +85,7 @@ msg(end) = " "; endif - error (msg); + error ("Octave:invalid-fun-call", msg); endif endfunction @@ -139,4 +140,3 @@ ## Stop reporting function as missing tests. No good tests possible. %!assert (1) -