Mercurial > hg > octave-lojdl
changeset 899:00e903c95534
[project @ 1994-11-09 18:06:56 by jwe]
author | jwe |
---|---|
date | Wed, 09 Nov 1994 18:06:56 +0000 |
parents | 4733b101ce3f |
children | f8c8c2461f4d |
files | src/error.cc |
diffstat | 1 files changed, 31 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/error.cc +++ b/src/error.cc @@ -144,7 +144,7 @@ { Octave_object retval; - char *msg = "unspecified_error"; + char *msg = "unspecified error"; int nargin = args.length (); @@ -173,7 +173,7 @@ { Octave_object retval; - char *msg = "unspecified_error"; + char *msg = "unspecified warning"; int nargin = args.length (); @@ -195,6 +195,35 @@ return retval; } +DEFUN ("usage", Fusage, Susage, 1, 1, + "usage (MESSAGE): print a usage MESSAGE.\n\ +\n\ +See also: error") +{ + Octave_object retval; + + char *msg = "unknown"; + + int nargin = args.length (); + + if (nargin == 1 && args(0).is_defined ()) + { + if (args(0).is_string ()) + { + msg = args(0).string_value (); + + if (! msg || ! *msg) + return retval; + } + else if (args(0).is_empty ()) + return retval; + } + + usage (msg); + + return retval; +} + /* ;;; Local Variables: *** ;;; mode: C++ ***