Mercurial > hg > octave-terminal
changeset 5823:080c08b192d8
[project @ 2006-05-19 05:32:17 by jwe]
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-19 John W. Eaton <jwe@octave.org> + + * mk-opts.pl (emit_print_function, emit_options_function): + Generate print_usage calls with no args. + 2006-05-11 John W. Eaton <jwe@octave.org> * configure.in (localfcnfilepath, localoctfilepath, fcnfilepath,
--- a/mk-opts.pl +++ b/mk-opts.pl @@ -677,7 +677,7 @@ print " }\n\n"; } - print "print_usage (\"$opt_fcn_name\", true, buf.str ()); + print "print_usage (); }\n\n"; } @@ -874,7 +874,7 @@ error (\"$opt_fcn_name: expecting keyword as first argument\"); } else - print_usage (\"$opt_fcn_name\"); + print_usage (); return retval; }\n";
--- a/scripts/time/weekday.m +++ b/scripts/time/weekday.m @@ -38,7 +38,7 @@ function [n, s] = weekday (d, form) if (nargin < 1 || nargin > 2) - usage("[n, s] = weekday (d, [form])"); + print_usage (); endif if (nargin < 2)
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2006-05-19 John W. Eaton <jwe@octave.org> + + * symtab.cc (SYMBOL_DEF::document): If definition is a function, + also pass doc string to function object. + * ov-fcn.h (octave_function::document): New function. + * defun.cc (print_usage (octave_function *)): New function. + (print_usage (void)): New function. + (print_usage (const std::string&)): Provide for backward + compatibility. Ignore arg. + (Fprint_usage): Don't accept arg. + * defun-int.h (print_usage (void)): Provide decl. + (print_usage (const std::string&)): Tag with GCC_ATTR_DEPRECATED. + 2006-05-04 David Bateman <dbateman@free.fr> * DLD-FUNCTIONS/conv2.cc: New file from Octave Forge.
--- a/src/DLD-FUNCTIONS/__glpk__.cc +++ b/src/DLD-FUNCTIONS/__glpk__.cc @@ -425,7 +425,7 @@ if (nrhs != 9) { - print_usage ("__glpk__"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/__gnuplot_raw__.l +++ b/src/DLD-FUNCTIONS/__gnuplot_raw__.l @@ -1640,7 +1640,7 @@ gnuplot::send_raw (cmd); } else - print_usage ("__gnuplot_raw__"); + print_usage (); return octave_value_list (); }
--- a/src/DLD-FUNCTIONS/__qp__.cc +++ b/src/DLD-FUNCTIONS/__qp__.cc @@ -512,7 +512,7 @@ error ("__qp__: invalid arguments"); } else - print_usage ("__qp__"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/balance.cc +++ b/src/DLD-FUNCTIONS/balance.cc @@ -120,7 +120,7 @@ if (nargin < 1 || nargin > 3 || nargout < 0 || nargout > 4) { - print_usage ("balance"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/besselj.cc +++ b/src/DLD-FUNCTIONS/besselj.cc @@ -271,7 +271,7 @@ } } else - print_usage (fn); + print_usage (); return retval; } @@ -403,7 +403,7 @@ error ("besselh: invalid value of K"); } else - print_usage ("besselh"); + print_usage (); return retval; } @@ -498,7 +498,7 @@ } } else - print_usage ("airy"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/betainc.cc +++ b/src/DLD-FUNCTIONS/betainc.cc @@ -170,7 +170,7 @@ } } else - print_usage ("betainc"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/cellfun.cc +++ b/src/DLD-FUNCTIONS/cellfun.cc @@ -91,7 +91,7 @@ if (nargin < 2) { error ("cellfun: you must supply at least 2 arguments"); - print_usage ("cellfun"); + print_usage (); return retval; } @@ -258,7 +258,7 @@ octave_value retval; if (nargin < 1 || nargin > 2) - print_usage ("num2cell"); + print_usage (); else { dim_vector dv = args(0).dims ();
--- a/src/DLD-FUNCTIONS/chol.cc +++ b/src/DLD-FUNCTIONS/chol.cc @@ -60,7 +60,7 @@ if (nargin != 1 || nargout > 2) { - print_usage ("chol"); + print_usage (); return retval; } @@ -174,7 +174,7 @@ } } else - print_usage ("chol"); + print_usage (); return retval; } @@ -224,7 +224,7 @@ } } else - print_usage ("chol2inv"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/colamd.cc +++ b/src/DLD-FUNCTIONS/colamd.cc @@ -274,7 +274,7 @@ int spumoni = 0; if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2) - print_usage ("colamd"); + print_usage (); else { // Get knobs @@ -510,7 +510,7 @@ int spumoni = 0; if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2) - print_usage ("symamd"); + print_usage (); else { // Get knobs @@ -655,7 +655,7 @@ int nargin = args.length (); if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2) - print_usage ("etree"); + print_usage (); else { octave_idx_type n_row, n_col, nnz;
--- a/src/DLD-FUNCTIONS/colloc.cc +++ b/src/DLD-FUNCTIONS/colloc.cc @@ -50,7 +50,7 @@ if (nargin < 1 || nargin > 3) { - print_usage ("colloc"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/conv2.cc +++ b/src/DLD-FUNCTIONS/conv2.cc @@ -264,7 +264,7 @@ if (nargin < 2) { - print_usage ("conv2"); + print_usage (); return retval; } else if (nargin == 3) @@ -289,7 +289,7 @@ else { error ("conv2: shape type not valid"); - print_usage ("conv2"); + print_usage (); return retval; } @@ -300,7 +300,7 @@ if (! (1 == args(0).rows () || 1 == args(0).columns ()) || ! (1 == args(1).rows () || 1 == args(1).columns ())) { - print_usage ("conv2"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/daspk.cc +++ b/src/DLD-FUNCTIONS/daspk.cc @@ -474,7 +474,7 @@ } } else - print_usage ("daspk"); + print_usage (); unwind_protect::run_frame ("Fdaspk");
--- a/src/DLD-FUNCTIONS/dasrt.cc +++ b/src/DLD-FUNCTIONS/dasrt.cc @@ -363,7 +363,7 @@ if (nargin < 4 || nargin > 6) { - print_usage ("dasrt"); + print_usage (); unwind_protect::run_frame ("Fdasrt"); return retval; }
--- a/src/DLD-FUNCTIONS/dassl.cc +++ b/src/DLD-FUNCTIONS/dassl.cc @@ -480,7 +480,7 @@ } } else - print_usage ("dassl"); + print_usage (); unwind_protect::run_frame ("Fdassl");
--- a/src/DLD-FUNCTIONS/det.cc +++ b/src/DLD-FUNCTIONS/det.cc @@ -47,7 +47,7 @@ if (nargin != 1) { - print_usage ("det"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/dispatch.cc +++ b/src/DLD-FUNCTIONS/dispatch.cc @@ -325,7 +325,7 @@ error ("builtin: lookup for symbol `%s' failed", name.c_str ()); } else - print_usage ("builtin"); + print_usage (); return retval; } @@ -447,7 +447,7 @@ if (nargin < 1 || nargin > 3) { - print_usage ("dispatch"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/eig.cc +++ b/src/DLD-FUNCTIONS/eig.cc @@ -50,7 +50,7 @@ if (nargin != 1 || nargout > 2) { - print_usage ("eig"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/expm.cc +++ b/src/DLD-FUNCTIONS/expm.cc @@ -125,7 +125,7 @@ if (nargin != 1) { - print_usage ("expm"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/fft.cc +++ b/src/DLD-FUNCTIONS/fft.cc @@ -49,7 +49,7 @@ if (nargin < 1 || nargin > 3) { - print_usage (fcn); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/fft2.cc +++ b/src/DLD-FUNCTIONS/fft2.cc @@ -51,7 +51,7 @@ if (nargin < 1 || nargin > 3) { - print_usage (fcn); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/fftn.cc +++ b/src/DLD-FUNCTIONS/fftn.cc @@ -50,7 +50,7 @@ if (nargin < 1 || nargin > 2) { - print_usage (fcn); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/fftw_wisdom.cc +++ b/src/DLD-FUNCTIONS/fftw_wisdom.cc @@ -92,7 +92,7 @@ if (nargin < 1 || nargin > 2) { - print_usage ("fftw_wisdom"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/filter.cc +++ b/src/DLD-FUNCTIONS/filter.cc @@ -367,7 +367,7 @@ if (nargin < 3 || nargin > 5) { - print_usage ("filter"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/find.cc +++ b/src/DLD-FUNCTIONS/find.cc @@ -194,7 +194,7 @@ if (nargin != 1 || nargout > 3) { - print_usage ("find"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/fsolve.cc +++ b/src/DLD-FUNCTIONS/fsolve.cc @@ -410,7 +410,7 @@ } } else - print_usage ("fsolve"); + print_usage (); unwind_protect::run_frame ("Ffsolve");
--- a/src/DLD-FUNCTIONS/gammainc.cc +++ b/src/DLD-FUNCTIONS/gammainc.cc @@ -121,7 +121,7 @@ } } else - print_usage ("gammainc"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/gcd.cc +++ b/src/DLD-FUNCTIONS/gcd.cc @@ -93,7 +93,7 @@ if (nargin == 0) { - print_usage ("gcd"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/getgrent.cc +++ b/src/DLD-FUNCTIONS/getgrent.cc @@ -87,7 +87,7 @@ retval(1) = msg; } else - print_usage ("getgrent"); + print_usage (); return retval; } @@ -127,7 +127,7 @@ } } else - print_usage ("getgrgid"); + print_usage (); return retval; } @@ -160,7 +160,7 @@ } } else - print_usage ("getgrnam"); + print_usage (); return retval; } @@ -186,7 +186,7 @@ retval(1) = msg; } else - print_usage ("setgrent"); + print_usage (); return retval; } @@ -212,7 +212,7 @@ retval(1) = msg; } else - print_usage ("endgrent"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/getpwent.cc +++ b/src/DLD-FUNCTIONS/getpwent.cc @@ -91,7 +91,7 @@ retval(1) = msg; } else - print_usage ("getpwent"); + print_usage (); return retval; } @@ -131,7 +131,7 @@ } } else - print_usage ("getpwuid"); + print_usage (); return retval; } @@ -164,7 +164,7 @@ } } else - print_usage ("getpwnam"); + print_usage (); return retval; } @@ -190,7 +190,7 @@ retval(1) = msg; } else - print_usage ("setpwent"); + print_usage (); return retval; } @@ -216,7 +216,7 @@ retval(1) = msg; } else - print_usage ("endpwent"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/givens.cc +++ b/src/DLD-FUNCTIONS/givens.cc @@ -71,7 +71,7 @@ if (nargin != 2 || nargout > 2) { - print_usage ("givens"); + print_usage (); return retval; } else
--- a/src/DLD-FUNCTIONS/hess.cc +++ b/src/DLD-FUNCTIONS/hess.cc @@ -67,7 +67,7 @@ if (nargin != 1 || nargout > 2) { - print_usage ("hess"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/inv.cc +++ b/src/DLD-FUNCTIONS/inv.cc @@ -46,7 +46,7 @@ if (nargin != 1) { - print_usage ("inv"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/kron.cc +++ b/src/DLD-FUNCTIONS/kron.cc @@ -96,7 +96,7 @@ if (nargin != 2 || nargout > 1) { - print_usage ("kron"); + print_usage (); } else if (args(0).is_complex_type () || args(1).is_complex_type ()) {
--- a/src/DLD-FUNCTIONS/lsode.cc +++ b/src/DLD-FUNCTIONS/lsode.cc @@ -467,7 +467,7 @@ } } else - print_usage ("lsode"); + print_usage (); unwind_protect::run_frame ("Flsode");
--- a/src/DLD-FUNCTIONS/lu.cc +++ b/src/DLD-FUNCTIONS/lu.cc @@ -76,7 +76,7 @@ if (nargin != 1 || nargout > 3) { - print_usage ("lu"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/luinc.cc +++ b/src/DLD-FUNCTIONS/luinc.cc @@ -96,7 +96,7 @@ octave_value_list retval; if (nargin == 0) - print_usage ("luinc"); + print_usage (); else if (nargin != 2) error ("luinc: incorrect number of arguments"); else
--- a/src/DLD-FUNCTIONS/matrix_type.cc +++ b/src/DLD-FUNCTIONS/matrix_type.cc @@ -104,7 +104,7 @@ octave_value retval; if (nargin == 0) - print_usage ("matrix_type"); + print_usage (); else if (nargin > 4) error ("matrix_type: incorrect number of arguments"); else
--- a/src/DLD-FUNCTIONS/minmax.cc +++ b/src/DLD-FUNCTIONS/minmax.cc @@ -48,7 +48,7 @@ \ if (nargin < 1 || nargin > 3 || nargout > 2) \ { \ - print_usage (#FCN); \ + print_usage (); \ return retval; \ } \ \
--- a/src/DLD-FUNCTIONS/pinv.cc +++ b/src/DLD-FUNCTIONS/pinv.cc @@ -53,7 +53,7 @@ if (nargin < 1 || nargin > 2) { - print_usage ("pinv"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/qr.cc +++ b/src/DLD-FUNCTIONS/qr.cc @@ -155,7 +155,7 @@ if (nargin != 1 && nargin != 2 || nargout > 3) { - print_usage ("qr"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/quad.cc +++ b/src/DLD-FUNCTIONS/quad.cc @@ -309,7 +309,7 @@ clear_function (fcn_name); } else - print_usage ("quad"); + print_usage (); unwind_protect::run_frame ("Fquad");
--- a/src/DLD-FUNCTIONS/qz.cc +++ b/src/DLD-FUNCTIONS/qz.cc @@ -292,7 +292,7 @@ if (nargin < 2 || nargin > 3 || nargout > 7) { - print_usage ("qz"); + print_usage (); return retval; } else if (nargin == 3 && (nargout < 3 || nargout > 4))
--- a/src/DLD-FUNCTIONS/regexp.cc +++ b/src/DLD-FUNCTIONS/regexp.cc @@ -95,7 +95,7 @@ if (nargin < 2) { - print_usage(nm); + print_usage (); return 0; } @@ -1086,7 +1086,7 @@ if (nargin < 3) { - print_usage("regexprep"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/schur.cc +++ b/src/DLD-FUNCTIONS/schur.cc @@ -250,7 +250,7 @@ if (nargin < 1 || nargin > 2 || nargout > 2) { - print_usage ("schur"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/sort.cc +++ b/src/DLD-FUNCTIONS/sort.cc @@ -735,7 +735,7 @@ if (nargin < 1 || nargin > 3) { - print_usage ("sort"); + print_usage (); return retval; } @@ -767,7 +767,7 @@ { if (args(1).is_string ()) { - print_usage ("sort"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/sparse.cc +++ b/src/DLD-FUNCTIONS/sparse.cc @@ -52,7 +52,7 @@ { if (args.length() != 1) { - print_usage("issparse"); + print_usage (); return octave_value (); } else @@ -120,7 +120,7 @@ int nargin= args.length(); if (nargin < 1 || (nargin == 4 && !args(3).is_string ()) || nargin > 6) { - print_usage ("sparse"); + print_usage (); return retval; } @@ -376,7 +376,7 @@ if (args.length() < 1) { - print_usage ("full"); + print_usage (); return retval; } @@ -554,7 +554,7 @@ if (nargin != 1) { - print_usage ("spfind"); + print_usage (); return retval; } @@ -590,7 +590,7 @@ int nargin = args.length(); \ octave_value retval; \ if ((nargin != 1 ) && (nargin != 2)) \ - print_usage (#NAME); \ + print_usage (); \ else { \ int dim = (nargin == 1 ? -1 : args(1).int_value(true) - 1); \ if (error_state) return retval; \ @@ -606,7 +606,7 @@ octave_sparse_complex_matrix::static_type_id ()) { \ retval = args(0).sparse_complex_matrix_value () .FUNC (dim); \ } else \ - print_usage (#NAME); \ + print_usage (); \ } \ return retval @@ -694,7 +694,7 @@ \ if (nargin < 1 || nargin > 3 || nargout > 2) \ { \ - print_usage (#FCN); \ + print_usage (); \ return retval; \ } \ \ @@ -1036,7 +1036,7 @@ retval = atan2 (a, b); } else - print_usage("spatan2"); + print_usage (); return retval; } @@ -1250,7 +1250,7 @@ else if (nargin == 2 && args(0).is_defined () && args(1).is_defined ()) retval = make_spdiag (args(0), args(1)); else - print_usage ("spdiag"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/spchol.cc +++ b/src/DLD-FUNCTIONS/spchol.cc @@ -46,7 +46,7 @@ if (nargin != 1 || nargout > 3) { - print_usage (name); + print_usage (); return retval; } @@ -273,7 +273,7 @@ } } else - print_usage ("spcholinv"); + print_usage (); return retval; } @@ -326,7 +326,7 @@ } } else - print_usage ("spchol2inv"); + print_usage (); return retval; } @@ -388,7 +388,7 @@ if (nargin < 1 || nargin > 3 || nargout > 5) { - print_usage ("symbfact"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/spdet.cc +++ b/src/DLD-FUNCTIONS/spdet.cc @@ -52,7 +52,7 @@ if (nargin != 1) { - print_usage ("spdet"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/spkron.cc +++ b/src/DLD-FUNCTIONS/spkron.cc @@ -109,7 +109,7 @@ if (nargin != 2 || nargout > 1) { - print_usage ("kron"); + print_usage (); } else if (args(0).is_complex_type () || args(1).is_complex_type ()) {
--- a/src/DLD-FUNCTIONS/splu.cc +++ b/src/DLD-FUNCTIONS/splu.cc @@ -77,7 +77,7 @@ if (nargin < 1 || nargin > 3 || nargout > 4) { - print_usage ("splu"); + print_usage (); return retval; } @@ -416,7 +416,7 @@ if (nargin != 1) { - print_usage ("inv"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/spqr.cc +++ b/src/DLD-FUNCTIONS/spqr.cc @@ -80,7 +80,7 @@ bool have_b = false; if (nargin < 1 || nargin > 3) - print_usage ("spqr"); + print_usage (); else { if (args(0).is_complex_type ()) @@ -258,7 +258,7 @@ #if HAVE_CXSPARSE if (nargin != 1) { - print_usage ("dmperm"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/sqrtm.cc +++ b/src/DLD-FUNCTIONS/sqrtm.cc @@ -124,7 +124,7 @@ if (nargin != 1) { - print_usage ("sqrtm"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/svd.cc +++ b/src/DLD-FUNCTIONS/svd.cc @@ -123,7 +123,7 @@ if (nargin < 1 || nargin > 2 || nargout == 2 || nargout > 3) { - print_usage ("svd"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/syl.cc +++ b/src/DLD-FUNCTIONS/syl.cc @@ -66,7 +66,7 @@ if (nargin != 3 || nargout > 1) { - print_usage ("syl"); + print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/time.cc +++ b/src/DLD-FUNCTIONS/time.cc @@ -91,7 +91,7 @@ if (args.length () == 0) retval = static_cast<double> (octave_time ()); else - print_usage ("time"); + print_usage (); return retval; } @@ -133,7 +133,7 @@ retval = octave_value (mk_tm_map (octave_gmtime (tmp))); } else - print_usage ("gmtime"); + print_usage (); return retval; } @@ -175,7 +175,7 @@ retval = octave_value (mk_tm_map (octave_localtime (tmp))); } else - print_usage ("localtime"); + print_usage (); return retval; } @@ -214,7 +214,7 @@ error ("mktime: expecting structure argument"); } else - print_usage ("mktime"); + print_usage (); return retval; } @@ -398,7 +398,7 @@ error ("strftime: expecting format string as first argument"); } else - print_usage ("strftime"); + print_usage (); return retval; } @@ -439,7 +439,7 @@ error ("strptime: expecting string as first argument"); } else - print_usage ("strptime"); + print_usage (); return retval; }
--- a/src/__gnuplot_raw__.l +++ b/src/__gnuplot_raw__.l @@ -1747,7 +1747,7 @@ gnuplot::send_raw (cmd); } else - print_usage ("__gnuplot_raw__"); + print_usage (); return octave_value_list (); }
--- a/src/bitfcns.cc +++ b/src/bitfcns.cc @@ -251,7 +251,7 @@ error ("%s: must have matching operand types", FNAME); \ } \ else \ - print_usage (FNAME); \ + print_usage (); \ \ return retval @@ -470,7 +470,7 @@ error ("bitshift: not defined for %s objects", cname.c_str ()); } else - print_usage ("bitshift"); + print_usage (); return retval; } @@ -484,7 +484,7 @@ { octave_value retval; if (args.length () != 0) - print_usage ("bitmax"); + print_usage (); else retval = (static_cast<double> (0x1FFFFFFFFFFFFFLL)); return retval; @@ -527,7 +527,7 @@ cname = args(0).string_value (); else if (nargin != 0) { - print_usage ("intmax"); + print_usage (); return retval; } @@ -590,7 +590,7 @@ cname = args(0).string_value (); else if (nargin != 0) { - print_usage ("intmin"); + print_usage (); return retval; }
--- a/src/data.cc +++ b/src/data.cc @@ -68,7 +68,7 @@ error (#FCN ": expecting dimension argument to be an integer"); \ } \ else \ - print_usage (#FCN); \ + print_usage (); \ \ return retval @@ -262,7 +262,7 @@ error ("atan2: nonconformant matrices"); } else - print_usage ("atan2"); + print_usage (); return retval; } @@ -353,7 +353,7 @@ error ("fmod: nonconformant matrices"); } else - print_usage ("fmod"); + print_usage (); return retval; } @@ -399,7 +399,7 @@ } \ } \ else \ - print_usage (#FCN); \ + print_usage (); \ \ return retval @@ -664,7 +664,7 @@ else if (nargin == 2 && args(0).is_defined () && args(1).is_defined ()) retval = make_diag (args(0), args(1)); else - print_usage ("diag"); + print_usage (); return retval; } @@ -770,7 +770,7 @@ error ("%s: invalid dimension argument", fname.c_str ()); } else - print_usage (fname); + print_usage (); return retval; } @@ -887,7 +887,7 @@ retval = ret; } else - print_usage (fname); + print_usage (); return retval; } @@ -937,7 +937,7 @@ retval = len; } else - print_usage ("length"); + print_usage (); return retval; } @@ -960,7 +960,7 @@ retval = n_dims; } else - print_usage ("ndims"); + print_usage (); return retval; } @@ -987,7 +987,7 @@ } } else - print_usage ("numel"); + print_usage (); return retval; } @@ -1073,7 +1073,7 @@ } } else - print_usage ("size"); + print_usage (); return retval; } @@ -1090,7 +1090,7 @@ if (args.length () == 1) retval = args(0).nnz (); else - print_usage ("nnz"); + print_usage (); return retval; } @@ -1111,7 +1111,7 @@ if (args.length() == 1) retval = args(0).nzmax (); else - print_usage ("nzmax"); + print_usage (); return retval; } @@ -1128,7 +1128,7 @@ if (args.length () == 1) retval = args(0).rows (); else - print_usage ("rows"); + print_usage (); return retval; } @@ -1145,7 +1145,7 @@ if (args.length () == 1) retval = args(0).columns (); else - print_usage ("columns"); + print_usage (); return retval; } @@ -1193,7 +1193,7 @@ if (args.length () == 1) retval = args(0).is_bool_type (); else - print_usage ("isbool"); + print_usage (); return retval; } @@ -1211,7 +1211,7 @@ if (args.length () == 1) retval = args(0).is_complex_type (); else - print_usage ("iscomplex"); + print_usage (); return retval; } @@ -1331,7 +1331,7 @@ error ("complex: invalid conversion"); } else - print_usage ("complex"); + print_usage (); return retval; } @@ -1348,7 +1348,7 @@ if (args.length () == 1) retval = args(0).is_real_type (); else - print_usage ("isreal"); + print_usage (); return retval; } @@ -1365,7 +1365,7 @@ if (args.length () == 1) retval = args(0).is_empty (); else - print_usage ("isempty"); + print_usage (); return retval; } @@ -1381,7 +1381,7 @@ if (args.length () == 1) retval = args(0).is_numeric_type (); else - print_usage ("isnumeric"); + print_usage (); return retval; } @@ -1397,7 +1397,7 @@ if (args.length () == 1) retval = args(0).is_list (); else - print_usage ("islist"); + print_usage (); return retval; } @@ -1420,7 +1420,7 @@ retval = (arg.rows () >= 1 && arg.columns () >= 1); } else - print_usage ("ismatrix"); + print_usage (); return retval; } @@ -2239,7 +2239,7 @@ break; default: - print_usage ("eye"); + print_usage (); break; } @@ -2267,7 +2267,7 @@ if (nargin != 2 && nargin != 3) { - print_usage ("linspace"); + print_usage (); return retval; } @@ -2362,7 +2362,7 @@ } } else - print_usage ("resize"); + print_usage (); return retval; } @@ -2450,7 +2450,7 @@ } else { - print_usage ("reshape"); + print_usage (); return retval; } @@ -2509,7 +2509,7 @@ if (args.length () == 1) retval = args(0).squeeze (); else - print_usage ("squeeze"); + print_usage (); return retval; }
--- a/src/defaults.cc +++ b/src/defaults.cc @@ -570,7 +570,7 @@ error ("genpath: expecting argument to be a character string"); } else - print_usage ("genpath"); + print_usage (); return retval; } @@ -750,7 +750,7 @@ if (args.length () == 0) retval = Voctave_home; else - print_usage ("OCTAVE_HOME"); + print_usage (); return retval; } @@ -768,7 +768,7 @@ if (nargin == 0) retval = OCTAVE_VERSION; else - print_usage ("OCTAVE_VERSION"); + print_usage (); return retval; }
--- a/src/defun-int.h +++ b/src/defun-int.h @@ -34,8 +34,8 @@ class octave_value; -extern void print_usage (const std::string& nm, bool just_usage = false, - const std::string& extra_msg = std::string ()); +extern void print_usage (void); +extern void print_usage (const std::string&) GCC_ATTR_DEPRECATED; extern void check_version (const std::string& version, const std::string& fcn);
--- a/src/defun.cc +++ b/src/defun.cc @@ -36,69 +36,78 @@ #include "ov.h" #include "ov-builtin.h" #include "ov-dld-fcn.h" +#include "ov-fcn.h" #include "ov-mapper.h" +#include "ov-usr-fcn.h" #include "oct-obj.h" #include "pager.h" #include "symtab.h" +#include "toplev.h" #include "variables.h" -// FIXME -- this function could probably share some code with -// the help functions. +// Print the usage part of the doc string of FCN (user-defined or DEFUN). -void -print_usage (const std::string& nm, bool just_usage, - const std::string& extra_msg) +static void +print_usage (octave_function *fcn) { - symbol_record *sym_rec = fbi_sym_tab->lookup (nm); - - if (sym_rec) + if (fcn) { - std::string h = sym_rec->help (); + std::string nm = fcn->name (); - if (h.length () > 0) + std::string doc = fcn->doc_string (); + + if (doc.length () > 0) { std::ostringstream buf; buf << "\nInvalid call to " << nm << ". Correct usage is:\n\n"; - h = extract_help_from_dispatch (nm) + h; - - display_usage_text (buf, h); + display_usage_text (buf, doc); - buf << extra_msg << "\n"; + buf << "\n"; - if (! just_usage) - additional_help_message (buf); + additional_help_message (buf); defun_usage_message (buf.str ()); } + else + error ("no usage message found for `%s'", nm.c_str ()); } else - warning ("no usage message found for `%s'", nm.c_str ()); + error ("print_usage: invalid function"); +} + +// Print the usage part of the doc string of the current function +// (user-defined or DEFUN). + +void +print_usage (void) +{ + print_usage (octave_call_stack::current ()); +} + +// Deprecated. +void +print_usage (const std::string&) +{ + print_usage (); } DEFUN (print_usage, args, , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} print_usage (@var{fname})\n\ -Print the usage message for the function named @var{fname}. The\n\ -@code{print_usage} function is only intended to work inside the\n\ -named function.\n\ +@deftypefn {Loadable Function} {} print_usage ()\n\ +Print the usage message for the currently executing function. The\n\ +@code{print_usage} function is only intended to work inside a\n\ +user-defined function.\n\ @seealso{help}\n\ @end deftypefn") { octave_value retval; - if (args.length () == 1) - { - std::string fname = args(0).string_value (); - - if (! error_state) - print_usage (fname); - else - error ("print_usage: expecting character string"); - } + if (args.length () == 0) + print_usage (octave_call_stack::caller_user_function ()); else - print_usage ("print_usage"); + print_usage (); return retval; } @@ -229,7 +238,7 @@ } } else - print_usage ("alias"); + print_usage (); return retval; }
--- a/src/dirfns.cc +++ b/src/dirfns.cc @@ -281,7 +281,7 @@ } } else - print_usage ("readdir"); + print_usage (); return retval; } @@ -330,7 +330,7 @@ } } else - print_usage ("mkdir"); + print_usage (); return retval; } @@ -404,7 +404,7 @@ } } else - print_usage ("rmdir"); + print_usage (); return retval; } @@ -451,7 +451,7 @@ } } else - print_usage ("link"); + print_usage (); return retval; } @@ -498,7 +498,7 @@ } } else - print_usage ("symlink"); + print_usage (); return retval; } @@ -543,7 +543,7 @@ } } else - print_usage ("readlink"); + print_usage (); return retval; } @@ -590,7 +590,7 @@ } } else - print_usage ("rename"); + print_usage (); return retval; } @@ -629,7 +629,7 @@ } } else - print_usage ("glob"); + print_usage (); return retval; } @@ -675,7 +675,7 @@ } } else - print_usage ("fnmatch"); + print_usage (); return retval; } @@ -692,7 +692,7 @@ if (args.length () == 0) retval = file_ops::dir_sep_str; else - print_usage ("filesep"); + print_usage (); return retval; } @@ -710,7 +710,7 @@ if (args.length () == 0) retval = dir_path::path_sep_str; else - print_usage ("pathsep"); + print_usage (); return retval; }
--- a/src/error.cc +++ b/src/error.cc @@ -1147,7 +1147,7 @@ error ("lasterr: expecting arguments to be character strings"); } else - print_usage ("lasterr"); + print_usage (); return retval; } @@ -1194,7 +1194,7 @@ error ("lastwarn: expecting arguments to be character strings"); } else - print_usage ("lastwarn"); + print_usage (); return retval; }
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -202,7 +202,7 @@ if (nargin == 1) retval = octave_stream_list::remove (args(0), "fclose"); else - print_usage ("fclose"); + print_usage (); return retval; } @@ -227,7 +227,7 @@ os.clearerr (); } else - print_usage ("fclear"); + print_usage (); return retval; } @@ -270,7 +270,7 @@ } } else - print_usage ("fflush"); + print_usage (); return retval; } @@ -319,7 +319,7 @@ } } else - print_usage (who); + print_usage (); return retval; } @@ -368,7 +368,7 @@ } } else - print_usage (who); + print_usage (); return retval; } @@ -622,7 +622,7 @@ } } else - print_usage ("fopen"); + print_usage (); return retval; } @@ -681,7 +681,7 @@ result = os.rewind (); } else - print_usage ("frewind"); + print_usage (); if (nargout > 0) retval = result; @@ -722,7 +722,7 @@ } } else - print_usage ("fseek"); + print_usage (); return retval; } @@ -747,7 +747,7 @@ retval = os.tell (); } else - print_usage ("ftell"); + print_usage (); return retval; } @@ -804,7 +804,7 @@ } } else - print_usage (who); + print_usage (); if (nargout > 0) retval = result; @@ -854,7 +854,7 @@ ::error ("%s: format must be a string", who.c_str ()); } else - print_usage (who); + print_usage (); if (nargout > 0) retval = result; @@ -884,7 +884,7 @@ retval = os.puts (args(1), who); } else - print_usage (who); + print_usage (); return retval; } @@ -904,7 +904,7 @@ if (args.length () == 1) retval = stdout_stream.puts (args(0), who); else - print_usage (who); + print_usage (); return retval; } @@ -961,7 +961,7 @@ ::error ("%s: unable to create output buffer", who.c_str ()); } else - print_usage (who); + print_usage (); return retval; } @@ -1065,7 +1065,7 @@ } } else - print_usage (who); + print_usage (); } return retval; @@ -1157,7 +1157,7 @@ ::error ("%s: first argument must be a string", who.c_str ()); } else - print_usage (who); + print_usage (); } return retval; @@ -1459,7 +1459,7 @@ } } else - print_usage ("fread"); + print_usage (); return retval; } @@ -1557,7 +1557,7 @@ } } else - print_usage ("fwrite"); + print_usage (); return retval; } @@ -1584,7 +1584,7 @@ retval = os.eof () ? 1.0 : 0.0; } else - print_usage ("feof"); + print_usage (); return retval; } @@ -1629,7 +1629,7 @@ } } else - print_usage ("ferror"); + print_usage (); return retval; } @@ -1703,7 +1703,7 @@ ::error ("popen: name must be a string"); } else - print_usage ("popen"); + print_usage (); return retval; } @@ -1722,7 +1722,7 @@ if (nargin == 1) retval = octave_stream_list::remove (args(0), "pclose"); else - print_usage ("pclose"); + print_usage (); return retval; } @@ -1763,7 +1763,7 @@ ::error ("expecting first argument to be a string"); } else - print_usage ("tmpnam"); + print_usage (); return retval; } @@ -1817,7 +1817,7 @@ } } else - print_usage ("tmpfile"); + print_usage (); return retval; } @@ -1908,7 +1908,7 @@ error ("mkstemp: expecting string as first argument"); } else - print_usage ("mkstemp"); + print_usage (); #else retval(2) = "mkstemp: not supported on this sytem"; @@ -1985,7 +1985,7 @@ } } else - print_usage ("umask"); + print_usage (); if (status >= 0) retval(0) = status; @@ -2003,7 +2003,7 @@ if (nargin == 0) retval = val; else - print_usage (nm); + print_usage (); return retval; } @@ -2026,7 +2026,7 @@ if (nargin == 0) retval = P_tmpdir; else - print_usage ("P_tmpdir"); + print_usage (); return retval; } @@ -2085,7 +2085,7 @@ if (nargin == 0) retval = val; else - print_usage (nm); + print_usage (); return retval; }
--- a/src/help.cc +++ b/src/help.cc @@ -1210,10 +1210,10 @@ retval = output_buf.str (); } else - print_usage ("type"); + print_usage (); } else - print_usage ("type"); + print_usage (); } abort: @@ -1294,7 +1294,7 @@ } } else - print_usage (argv[0]); + print_usage (); } return retval;
--- a/src/input.cc +++ b/src/input.cc @@ -732,7 +732,7 @@ if (nargin == 1 || nargin == 2) retval = get_user_input (args, false, nargout); else - print_usage ("input"); + print_usage (); return retval; } @@ -787,7 +787,7 @@ retval = octave_yes_or_no (prompt); } else - print_usage ("yes_or_no"); + print_usage (); return retval; } @@ -851,7 +851,7 @@ if (nargin == 0 || nargin == 1) do_keyboard (args); else - print_usage ("keyboard"); + print_usage (); return retval; } @@ -913,7 +913,7 @@ else if (arg == "off") Vecho_executing_commands = ECHO_OFF; else - print_usage ("echo"); + print_usage (); } break; @@ -929,12 +929,12 @@ else if (arg == "off" && argv[2] == "all") Vecho_executing_commands = ECHO_OFF; else - print_usage ("echo"); + print_usage (); } break; default: - print_usage ("echo"); + print_usage (); break; } @@ -1012,7 +1012,7 @@ } } else - print_usage ("completion_matches"); + print_usage (); return retval; } @@ -1039,7 +1039,7 @@ command_editor::read_init_file (file); } else - print_usage ("read_readline_init_file"); + print_usage (); return retval; } @@ -1089,7 +1089,7 @@ int nargin = args.length (); if (nargin > 2) - print_usage ("input_event_hook"); + print_usage (); else { octave_value tmp_user_data;
--- a/src/lex.l +++ b/src/lex.l @@ -2464,7 +2464,7 @@ retval = is_keyword (argv[1]); } else - print_usage ("iskeyword"); + print_usage (); return retval; }
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -780,7 +780,7 @@ if (i == argc) { - print_usage ("load"); + print_usage (); return retval; } @@ -1595,7 +1595,7 @@ if (i == argc) { - print_usage ("save"); + print_usage (); return retval; } @@ -1629,7 +1629,7 @@ else if (i == argc - 1 && glob_pattern_p (argv[i])) { - print_usage ("save"); + print_usage (); return retval; } else
--- a/src/octave.cc +++ b/src/octave.cc @@ -250,7 +250,7 @@ else if (nargin == 0) retval = vinfo; else - print_usage ("__version_info__"); + print_usage (); return retval; } @@ -791,7 +791,7 @@ if (args.length () == 0) retval = Cell (octave_argv); else - print_usage ("argv"); + print_usage (); return retval; } @@ -813,7 +813,7 @@ if (args.length () == 0) retval = octave_program_invocation_name; else - print_usage ("program_invocation_name"); + print_usage (); return retval; } @@ -831,7 +831,7 @@ if (args.length () == 0) retval = octave_program_name; else - print_usage ("program_name"); + print_usage (); return retval; }
--- a/src/ov-cell.cc +++ b/src/ov-cell.cc @@ -916,7 +916,7 @@ if (args.length () == 1) retval = args(0).is_cell (); else - print_usage ("iscell"); + print_usage (); return retval; } @@ -1028,7 +1028,7 @@ retval = false; } else - print_usage ("iscellstr"); + print_usage (); return retval; } @@ -1064,7 +1064,7 @@ } } else - print_usage ("cellstr"); + print_usage (); return retval; } @@ -1147,7 +1147,7 @@ error ("struct2cell: expecting argument to be a cell array"); } else - print_usage ("struct2cell"); + print_usage (); return retval; }
--- a/src/ov-fcn-handle.cc +++ b/src/ov-fcn-handle.cc @@ -666,7 +666,7 @@ error ("functions: argument must be a function handle object"); } else - print_usage ("functions"); + print_usage (); return retval; } @@ -693,7 +693,7 @@ error ("func2str: expecting valid function handle as first argument"); } else - print_usage ("func2str"); + print_usage (); return retval; } @@ -716,7 +716,7 @@ error ("str2func: expecting string as first argument"); } else - print_usage ("str2func"); + print_usage (); return retval; }
--- a/src/ov-fcn-inline.cc +++ b/src/ov-fcn-inline.cc @@ -718,7 +718,7 @@ error ("inline: first argument must be a string"); } else - print_usage ("inline"); + print_usage (); return retval; } @@ -746,7 +746,7 @@ error ("formula: must be an inline function"); } else - print_usage ("formula"); + print_usage (); return retval; } @@ -782,7 +782,7 @@ error ("argnames: argument must be an inline function"); } else - print_usage ("argnames"); + print_usage (); return retval; } @@ -852,7 +852,7 @@ } } else - print_usage ("vectorize"); + print_usage (); return retval; }
--- a/src/ov-fcn.h +++ b/src/ov-fcn.h @@ -91,6 +91,8 @@ std::string name (void) const { return my_name; } + void document (const std::string& ds) { doc = ds; } + std::string doc_string (void) const { return doc; } virtual void unload (void) { }
--- a/src/ov-list.cc +++ b/src/ov-list.cc @@ -396,7 +396,7 @@ error ("nth: first argument must be a list"); } else - print_usage ("nth"); + print_usage (); return retval; } @@ -443,7 +443,7 @@ } } else - print_usage ("append"); + print_usage (); return retval; } @@ -466,7 +466,7 @@ retval = octave_value (tmp.reverse ()); } else - print_usage ("reverse"); + print_usage (); return retval; } @@ -532,7 +532,7 @@ error ("splice: first argument must be a list"); } else - print_usage ("splice"); + print_usage (); return retval; }
--- a/src/ov-streamoff.cc +++ b/src/ov-streamoff.cc @@ -89,7 +89,7 @@ if (args.length () == 1) retval = args(0).is_streamoff (); else - print_usage ("isstreamoff"); + print_usage (); return retval; }
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -656,7 +656,7 @@ if (args.length () == 1) retval = args(0).is_map (); else - print_usage ("isstruct"); + print_usage (); return retval; } @@ -688,7 +688,7 @@ gripe_wrong_type_arg ("fieldnames", args(0)); } else - print_usage ("fieldnames"); + print_usage (); return retval; } @@ -722,7 +722,7 @@ } } else - print_usage ("isfield"); + print_usage (); return retval; } @@ -960,7 +960,7 @@ error ("cell2struct: expecting first argument to be a cell array"); } else - print_usage ("cell2struct"); + print_usage (); return retval; } @@ -1011,7 +1011,7 @@ } } else - print_usage ("rmfield"); + print_usage (); return retval; }
--- a/src/ov-type-conv.h +++ b/src/ov-type-conv.h @@ -68,7 +68,7 @@ } \ } \ else \ - print_usage (#NAME); \ + print_usage (); \ \ return retval
--- a/src/ov-typeinfo.cc +++ b/src/ov-typeinfo.cc @@ -491,7 +491,7 @@ else if (nargin == 1) retval = args(0).type_name (); else - print_usage ("typeinfo"); + print_usage (); return retval; } @@ -510,7 +510,7 @@ if (nargin == 1) retval = args(0).class_name (); else - print_usage ("class"); + print_usage (); return retval; }
--- a/src/ov-usr-fcn.cc +++ b/src/ov-usr-fcn.cc @@ -646,7 +646,7 @@ retval = sr ? sr->def () : 0; } else - print_usage ("nargin"); + print_usage (); return retval; } @@ -724,7 +724,7 @@ error ("nargout: invalid call at top level"); } else - print_usage ("nargout"); + print_usage (); return retval; } @@ -768,7 +768,7 @@ ::error ("va_arg only valid within function body"); } else - print_usage ("va_arg"); + print_usage (); return retval; } @@ -812,7 +812,7 @@ ::error ("va_start only valid within function body"); } else - print_usage ("va_start"); + print_usage (); return retval; } @@ -860,7 +860,7 @@ ::error ("vr_val only valid within function body"); } else - print_usage ("vr_val"); + print_usage (); return retval; }
--- a/src/ov.cc +++ b/src/ov.cc @@ -1866,7 +1866,7 @@ if (args.length () == 2) error ("cast: not implemented"); else - print_usage ("cast"); + print_usage (); return retval; } @@ -1883,7 +1883,7 @@ if (args.length () == 1) retval = args(0).byte_size (); else - print_usage ("sizeof"); + print_usage (); return retval; }
--- a/src/pager.cc +++ b/src/pager.cc @@ -480,7 +480,7 @@ break; default: - print_usage ("diary"); + print_usage (); break; } @@ -519,7 +519,7 @@ else if (argc == 1) Vpage_screen_output = ! Vpage_screen_output; else - print_usage ("more"); + print_usage (); return retval; }
--- a/src/parse.y +++ b/src/parse.y @@ -3507,7 +3507,7 @@ autoload_map[argv[1]] = argv[2]; } else - print_usage ("autoload"); + print_usage (); return retval; } @@ -3552,7 +3552,7 @@ if (nargin > 1) { - print_usage ("mfilename"); + print_usage (); return retval; } @@ -3625,7 +3625,7 @@ error ("source: expecting file name as argument"); } else - print_usage ("source"); + print_usage (); return retval; } @@ -3765,7 +3765,7 @@ if (nargin > 0) retval = feval (args, nargout); else - print_usage ("feval"); + print_usage (); return retval; } @@ -3913,7 +3913,7 @@ unwind_protect::run_frame ("Feval"); } else - print_usage ("eval"); + print_usage (); return retval; } @@ -3979,7 +3979,7 @@ error ("assignin: expecting string as first argument"); } else - print_usage ("assignin"); + print_usage (); return retval; } @@ -4050,7 +4050,7 @@ error ("evalin: expecting string as first argument"); } else - print_usage ("evalin"); + print_usage (); return retval; }
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -2542,7 +2542,7 @@ } } else - print_usage ("disp"); + print_usage (); return retval; } @@ -2585,7 +2585,7 @@ } } else - print_usage ("fdisp"); + print_usage (); return retval; }
--- a/src/sighandlers.cc +++ b/src/sighandlers.cc @@ -987,7 +987,7 @@ retval = m; } else - print_usage ("SIG"); + print_usage (); return retval; }
--- a/src/strfns.cc +++ b/src/strfns.cc @@ -122,7 +122,7 @@ retval = octave_value (result, '\''); } else - print_usage ("char"); + print_usage (); return retval; } @@ -140,7 +140,7 @@ if (nargin == 1 && args(0).is_defined ()) retval = args(0).is_string (); else - print_usage ("ischar"); + print_usage (); return retval; } @@ -369,7 +369,7 @@ retval = false; } else - print_usage ("strcmp"); + print_usage (); return retval; } @@ -415,7 +415,7 @@ error ("list_in_columns: expecting cellstr or char array"); } else - print_usage ("list_in_columns"); + print_usage (); return retval; }
--- a/src/symtab.cc +++ b/src/symtab.cc @@ -185,6 +185,21 @@ } void +SYMBOL_DEF::document (const std::string& h) +{ + help_string = h; + + if (is_function ()) + { + octave_function *defn = definition.function_value (); + + if (defn) + defn->document (h); + } +} + + +void SYMBOL_DEF::print_info (std::ostream& os, const std::string& prefix) const { os << prefix << "symbol_def::count: " << count << "\n";
--- a/src/symtab.h +++ b/src/symtab.h @@ -211,7 +211,7 @@ std::string help (void) const { return help_string; } - void document (const std::string& h) { help_string = h; } + void document (const std::string& h); unsigned int type (void) { return symbol_type; }
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -137,7 +137,7 @@ error ("dup2: invalid stream"); } else - print_usage ("dup2"); + print_usage (); return retval; } @@ -215,7 +215,7 @@ error ("exec: first argument must be a string"); } else - print_usage ("exec"); + print_usage (); return retval; } @@ -315,7 +315,7 @@ error ("fcntl: file id, request, and argument must be integers"); } else - print_usage ("fcntl"); + print_usage (); return retval; } @@ -360,7 +360,7 @@ retval(1) = msg; } else - print_usage ("fork"); + print_usage (); return retval; } @@ -386,7 +386,7 @@ retval(1) = msg; } else - print_usage ("getpgrp"); + print_usage (); return retval; } @@ -404,7 +404,7 @@ if (nargin == 0) retval = octave_syscalls::getpid (); else - print_usage ("getpid"); + print_usage (); return retval; } @@ -422,7 +422,7 @@ if (nargin == 0) retval = octave_syscalls::getppid (); else - print_usage ("getppid"); + print_usage (); return retval; } @@ -440,7 +440,7 @@ if (nargin == 0) retval = octave_syscalls::getegid (); else - print_usage ("getegid"); + print_usage (); return retval; } @@ -458,7 +458,7 @@ if (nargin == 0) retval = octave_syscalls::getgid (); else - print_usage ("getgid"); + print_usage (); return retval; } @@ -476,7 +476,7 @@ if (nargin == 0) retval = octave_syscalls::geteuid (); else - print_usage ("geteuid"); + print_usage (); return retval; } @@ -494,7 +494,7 @@ if (nargin == 0) retval = octave_syscalls::getuid (); else - print_usage ("getuid"); + print_usage (); return retval; } @@ -546,7 +546,7 @@ } } else - print_usage ("kill"); + print_usage (); return retval; } @@ -582,7 +582,7 @@ } } else - print_usage ("lstat"); + print_usage (); return retval; } @@ -637,7 +637,7 @@ error ("mkfifo: file name must be a string"); } else - print_usage ("mkfifo"); + print_usage (); return retval; } @@ -694,7 +694,7 @@ } } else - print_usage ("pipe"); + print_usage (); return retval; } @@ -819,7 +819,7 @@ } } else - print_usage ("stat"); + print_usage (); return retval; } @@ -844,7 +844,7 @@ error ("S_ISREG: invalid mode value"); } else - print_usage ("S_ISREG"); + print_usage (); return retval; } @@ -869,7 +869,7 @@ error ("S_ISDIR: invalid mode value"); } else - print_usage ("S_ISDIR"); + print_usage (); return retval; } @@ -894,7 +894,7 @@ error ("S_ISCHR: invalid mode value"); } else - print_usage ("S_ISCHR"); + print_usage (); return retval; } @@ -919,7 +919,7 @@ error ("S_ISBLK: invalid mode value"); } else - print_usage ("S_ISBLK"); + print_usage (); return retval; } @@ -944,7 +944,7 @@ error ("S_ISFIFO: invalid mode value"); } else - print_usage ("S_ISFIFO"); + print_usage (); return retval; } @@ -969,7 +969,7 @@ error ("S_ISLNK: invalid mode value"); } else - print_usage ("S_ISLNK"); + print_usage (); return retval; } @@ -992,7 +992,7 @@ error ("S_ISSOCK: invalid mode value"); } else - print_usage ("S_ISSOCK"); + print_usage (); return retval; } @@ -1039,7 +1039,7 @@ retval(0) = m; } else - print_usage ("uname"); + print_usage (); return retval; } @@ -1078,7 +1078,7 @@ error ("unlink: file name must be a string"); } else - print_usage ("unlink"); + print_usage (); return retval; } @@ -1166,7 +1166,7 @@ error ("waitpid: PID must be an integer value"); } else - print_usage ("waitpid"); + print_usage (); return retval; } @@ -1421,7 +1421,7 @@ error ("canonicalize_file_name: argument must be a character string"); } else - print_usage ("canonicalize_file_name"); + print_usage (); return retval; } @@ -1436,7 +1436,7 @@ if (nargin == 0) retval = val; else - print_usage (nm); + print_usage (); return retval; }
--- a/src/sysdep.cc +++ b/src/sysdep.cc @@ -480,7 +480,7 @@ retval = octave_env::getenv (name); } else - print_usage ("getenv"); + print_usage (); return retval; } @@ -512,7 +512,7 @@ error ("putenv: first argument should be a string"); } else - print_usage ("putenv"); + print_usage (); return retval; } @@ -586,7 +586,7 @@ if (! (nargin == 0 || nargin == 1)) { - print_usage ("pause"); + print_usage (); return retval; } @@ -637,7 +637,7 @@ } } else - print_usage ("sleep"); + print_usage (); return retval; } @@ -671,7 +671,7 @@ } } else - print_usage ("usleep"); + print_usage (); return retval; } @@ -731,7 +731,7 @@ if (nargin == 1) retval = file_ops::tilde_expand (args(0).all_strings ()); else - print_usage ("tilde_expand"); + print_usage (); return retval; }
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -315,7 +315,7 @@ else if (argc > 1 && argv[1] == "on") ; // ok. else - print_usage ("casesen"); + print_usage (); return retval; } @@ -582,7 +582,7 @@ } } else - print_usage ("system"); + print_usage (); unwind_protect::run_frame ("Fsystem"); @@ -681,7 +681,7 @@ #endif } else - print_usage ("atexit"); + print_usage (); return retval; } @@ -878,7 +878,7 @@ else if (nargin == 0) retval = m; else - print_usage ("octave_config_info"); + print_usage (); return retval; }
--- a/src/utils.cc +++ b/src/utils.cc @@ -107,7 +107,7 @@ if (argc == 2) retval = valid_identifier (argv[1]); else - print_usage ("isvarname"); + print_usage (); return retval; } @@ -317,7 +317,7 @@ error ("file_in_loadpath: expecting string as first argument"); } else - print_usage ("file_in_loadpath"); + print_usage (); return retval; } @@ -386,7 +386,7 @@ error ("file_in_path: expecting string as first argument"); } else - print_usage ("file_in_path"); + print_usage (); return retval; } @@ -548,7 +548,7 @@ error ("do_string_escapes: argument must be a string"); } else - print_usage ("do_string_escapes"); + print_usage (); return retval; } @@ -652,7 +652,7 @@ error ("undo_string_escapes: argument must be a string"); } else - print_usage ("undo_string_escapes"); + print_usage (); return retval; } @@ -669,7 +669,7 @@ retval = Vload_path_dir_path.find_all_first_of (names); } else - print_usage ("find_first_of_in_loadpath"); + print_usage (); return retval; } @@ -713,7 +713,7 @@ else if (nargin == 0) retval = octave_errno::get (); else - print_usage ("errno"); + print_usage (); return retval; } @@ -729,7 +729,7 @@ if (args.length () == 0) retval = octave_errno::list (); else - print_usage ("errno_list"); + print_usage (); return retval; }
--- a/src/variables.cc +++ b/src/variables.cc @@ -158,7 +158,7 @@ } } else - print_usage ("mark_as_command"); + print_usage (); } else warning ("mark_as_command: invalid use inside function body"); @@ -192,7 +192,7 @@ } } else - print_usage ("unmark_command"); + print_usage (); } else warning ("mark_as_command: invalid use inside function body"); @@ -258,7 +258,7 @@ } } else - print_usage ("iscommand"); + print_usage (); return retval; } @@ -324,7 +324,7 @@ } } else - print_usage ("mark_as_rawcommand"); + print_usage (); } else warning ("mark_as_rawcommand: invalid use inside function body"); @@ -360,7 +360,7 @@ } } else - print_usage ("unmark_rawcommand"); + print_usage (); } else warning ("unmark_rawcommand: invalid use inside function body"); @@ -427,7 +427,7 @@ } } else - print_usage ("israwcommand"); + print_usage (); return retval; } @@ -726,7 +726,7 @@ if (nargin != 1) { - print_usage ("isglobal"); + print_usage (); return retval; } @@ -941,7 +941,7 @@ error ("exist: expecting first argument to be a string"); } else - print_usage ("exist"); + print_usage (); return retval; } @@ -1263,7 +1263,7 @@ error ("%s: expecting arg to be a logical value", nm); } else if (nargin > 1) - print_usage (nm); + print_usage (); return retval; } @@ -1304,7 +1304,7 @@ error ("%s: argument must be a single character", nm); } else if (nargin > 1) - print_usage (nm); + print_usage (); return retval; } @@ -1338,7 +1338,7 @@ error ("%s: expecting arg to be an integer value", nm); } else if (nargin > 1) - print_usage (nm); + print_usage (); return retval; } @@ -1372,7 +1372,7 @@ error ("%s: expecting arg to be a scalar value", nm); } else if (nargin > 1) - print_usage (nm); + print_usage (); return retval; } @@ -1403,7 +1403,7 @@ error ("%s: expecting arg to be a character string", nm); } else if (nargin > 1) - print_usage (nm); + print_usage (); return retval; } @@ -1524,7 +1524,7 @@ } } else - print_usage ("document"); + print_usage (); return retval; } @@ -1823,7 +1823,7 @@ retval = do_who (argc, argv, nargout == 1); } else - print_usage ("who"); + print_usage (); return retval; } @@ -1857,7 +1857,7 @@ retval = do_who (argc, argv, nargout == 1); } else - print_usage ("whos"); + print_usage (); return retval; } @@ -1945,7 +1945,7 @@ error ("mlock: invalid use outside a function"); } else - print_usage ("mlock"); + print_usage (); return retval; } @@ -1979,7 +1979,7 @@ error ("munlock: invalid use outside a function"); } else - print_usage ("munlock"); + print_usage (); return retval; } @@ -2014,7 +2014,7 @@ error ("mislocked: invalid use outside a function"); } else - print_usage ("mislocked"); + print_usage (); return retval; } @@ -2343,7 +2343,7 @@ { \ if (cond) \ { \ - print_usage ("clear"); \ + print_usage (); \ return retval; \ } \ } \ @@ -2559,7 +2559,7 @@ else if (nargin == 0) curr_sym_tab->print_info (octave_stdout); else - print_usage ("__print_symtab_info__"); + print_usage (); return retval; } @@ -2589,10 +2589,10 @@ symbol_name.c_str ()); } else - print_usage ("__print_symbol_info__"); + print_usage (); } else - print_usage ("__print_symbol_info__"); + print_usage (); return retval; } @@ -2655,7 +2655,7 @@ error ("ignore_function_time_stamp: expecting argument to be character string"); } else if (nargin > 1) - print_usage ("ignore_function_time_stamp"); + print_usage (); return retval; }