changeset 28789:28de41192f3c

Eliminate unneeded verification of nargin, nargout in m-files. * FIRfilter.m, FIRfilter_aggregation.m, get.m, polynomial.m, polynomial_superiorto.m, polynomial2.m, makeUniqueStrings.m, base64decode.m, base64encode.m, cd.m, lin2mu.m, record.m, sound.m, soundsc.m, accumarray.m, accumdim.m, bitcmp.m, bitset.m, cart2pol.m, celldisp.m, circshift.m, cplxpair.m, cumtrapz.m, flip.m, idivide.m, interpft.m, logspace.m, pol2cart.m, polyarea.m, postpad.m, prepad.m, rat.m, rot90.m, rotdim.m, shift.m, shiftdim.m, sortrows.m, trapz.m, dsearch.m, dsearchn.m, getappdata.m, getpixelposition.m, guidata.m, guihandles.m, isappdata.m, listfonts.m, uigetdir.m, waitforbuttonpress.m, __makeinfo__.m, doc.m, get_first_help_sentence.m, autumn.m, bone.m, brighten.m, cmpermute.m, cmunique.m, colorcube.m, contrast.m, cool.m, copper.m, cubehelix.m, flag.m, gray.m, gray2ind.m, hot.m, hsv.m, im2double.m, im2frame.m, imformats.m, jet.m, lines.m, ocean.m, pink.m, prism.m, rainbow.m, rgbplot.m, spinmap.m, spring.m, summer.m, viridis.m, white.m, winter.m, beep.m, importdata.m, is_valid_file_id.m, javachk.m, javaclasspath.m, findstr.m, genvarname.m, strmatch.m, bandwidth.m, commutation_matrix.m, cond.m, cross.m, isdefinite.m, ishermitian.m, issymmetric.m, krylov.m, linsolve.m, logm.m, lscov.m, null.m, ordeig.m, orth.m, rank.m, rref.m, vecnorm.m, bunzip2.m, citation.m, computer.m, copyfile.m, dir.m, dos.m, fileattrib.m, gunzip.m, inputParser.m, inputname.m, ismac.m, ispc.m, isunix.m, license.m, list_primes.m, methods.m, mkdir.m, movefile.m, nargchk.m, news.m, orderfields.m, recycle.m, tar.m, unix.m, unpack.m, untar.m, unzip.m, ver.m, version.m, what.m, zip.m, decic.m, fminbnd.m, fminunc.m, fsolve.m, fzero.m, glpk.m, humps.m, lsqnonneg.m, optimget.m, pqpnonneg.m, sqp.m, pathdef.m, camlookat.m, hidden.m, specular.m, plotmatrix.m, smooth3.m, sombrero.m, stemleaf.m, __gnuplot_drawnow__.m, __opengl_info__.m, ancestor.m, cla.m, close.m, closereq.m, copyobj.m, gca.m, gcf.m, ginput.m, graphics_toolkit.m, groot.m, hgload.m, hgsave.m, isgraphics.m, ishold.m, linkaxes.m, meshgrid.m, newplot.m, refresh.m, refreshdata.m, rotate.m, saveas.m, struct2hdl.m, conv.m, mkpp.m, mpoles.m, padecoef.m, pchip.m, polyder.m, polyfit.m, polygcd.m, polyint.m, polyout.m, polyval.m, ppder.m, ppint.m, getpref.m, ispref.m, rmpref.m, profexport.m, profshow.m, powerset.m, arch_fit.m, arma_rnd.m, blackman.m, detrend.m, diffpara.m, fftconv.m, fftfilt.m, filter2.m, freqz.m, freqz_plot.m, hamming.m, hanning.m, sinetone.m, sinewave.m, spectral_adf.m, spectral_xdf.m, stft.m, unwrap.m, gplot.m, ichol.m, ilu.m, spdiags.m, sprand.m, sprandn.m, spstats.m, svds.m, treelayout.m, treeplot.m, betainc.m, betaincinv.m, ellipke.m, gammainc.m, gammaincinv.m, legendre.m, pow2.m, hankel.m, pascal.m, rosser.m, toeplitz.m, bounds.m, corr.m, cov.m, histc.m, kendall.m, kurtosis.m, mad.m, mode.m, moment.m, prctile.m, quantile.m, range.m, ranks.m, run_count.m, skewness.m, spearman.m, std.m, var.m, zscore.m, dec2base.m, dec2bin.m, dec2hex.m, index.m, mat2str.m, native2unicode.m, ostrsplit.m, strjoin.m, strjust.m, strtok.m, substr.m, unicode2native.m, untabify.m, __debug_octave__.m, demo.m, example.m, fail.m, oruntests.m, dump_demos.m, speed.m, test.m, date.m, datenum.m, datestr.m, datevec.m, is_leap_year.m, now.m, weekday.m: Eliminate unneeded verification of nargin, nargout in m-files now that the interpreter checks these values.
author Rik <rik@octave.org>
date Thu, 24 Sep 2020 14:44:58 -0700
parents aba2c4eadb83
children edc52732a3d3
files examples/code/@FIRfilter/FIRfilter.m examples/code/@FIRfilter/FIRfilter_aggregation.m examples/code/@polynomial/get.m examples/code/@polynomial/polynomial.m examples/code/@polynomial/polynomial_superiorto.m examples/code/polynomial2.m scripts/+matlab/+lang/makeUniqueStrings.m scripts/+matlab/+net/base64decode.m scripts/+matlab/+net/base64encode.m scripts/@ftp/cd.m scripts/audio/lin2mu.m scripts/audio/record.m scripts/audio/sound.m scripts/audio/soundsc.m scripts/general/accumarray.m scripts/general/accumdim.m scripts/general/bitcmp.m scripts/general/bitset.m scripts/general/cart2pol.m scripts/general/celldisp.m scripts/general/circshift.m scripts/general/cplxpair.m scripts/general/cumtrapz.m scripts/general/flip.m scripts/general/idivide.m scripts/general/interpft.m scripts/general/logspace.m scripts/general/pol2cart.m scripts/general/polyarea.m scripts/general/postpad.m scripts/general/prepad.m scripts/general/rat.m scripts/general/rot90.m scripts/general/rotdim.m scripts/general/shift.m scripts/general/shiftdim.m scripts/general/sortrows.m scripts/general/trapz.m scripts/geometry/dsearch.m scripts/geometry/dsearchn.m scripts/gui/getappdata.m scripts/gui/getpixelposition.m scripts/gui/guidata.m scripts/gui/guihandles.m scripts/gui/isappdata.m scripts/gui/listfonts.m scripts/gui/uigetdir.m scripts/gui/waitforbuttonpress.m scripts/help/__makeinfo__.m scripts/help/doc.m scripts/help/get_first_help_sentence.m scripts/image/autumn.m scripts/image/bone.m scripts/image/brighten.m scripts/image/cmpermute.m scripts/image/cmunique.m scripts/image/colorcube.m scripts/image/contrast.m scripts/image/cool.m scripts/image/copper.m scripts/image/cubehelix.m scripts/image/flag.m scripts/image/gray.m scripts/image/gray2ind.m scripts/image/hot.m scripts/image/hsv.m scripts/image/im2double.m scripts/image/im2frame.m scripts/image/imformats.m scripts/image/jet.m scripts/image/lines.m scripts/image/ocean.m scripts/image/pink.m scripts/image/prism.m scripts/image/rainbow.m scripts/image/rgbplot.m scripts/image/spinmap.m scripts/image/spring.m scripts/image/summer.m scripts/image/viridis.m scripts/image/white.m scripts/image/winter.m scripts/io/beep.m scripts/io/importdata.m scripts/io/is_valid_file_id.m scripts/java/javachk.m scripts/java/javaclasspath.m scripts/legacy/findstr.m scripts/legacy/genvarname.m scripts/legacy/strmatch.m scripts/linear-algebra/bandwidth.m scripts/linear-algebra/commutation_matrix.m scripts/linear-algebra/cond.m scripts/linear-algebra/cross.m scripts/linear-algebra/isdefinite.m scripts/linear-algebra/ishermitian.m scripts/linear-algebra/issymmetric.m scripts/linear-algebra/krylov.m scripts/linear-algebra/linsolve.m scripts/linear-algebra/logm.m scripts/linear-algebra/lscov.m scripts/linear-algebra/null.m scripts/linear-algebra/ordeig.m scripts/linear-algebra/orth.m scripts/linear-algebra/rank.m scripts/linear-algebra/rref.m scripts/linear-algebra/vecnorm.m scripts/miscellaneous/bunzip2.m scripts/miscellaneous/citation.m scripts/miscellaneous/computer.m scripts/miscellaneous/copyfile.m scripts/miscellaneous/dir.m scripts/miscellaneous/dos.m scripts/miscellaneous/fileattrib.m scripts/miscellaneous/gunzip.m scripts/miscellaneous/inputParser.m scripts/miscellaneous/inputname.m scripts/miscellaneous/ismac.m scripts/miscellaneous/ispc.m scripts/miscellaneous/isunix.m scripts/miscellaneous/license.m scripts/miscellaneous/list_primes.m scripts/miscellaneous/methods.m scripts/miscellaneous/mkdir.m scripts/miscellaneous/movefile.m scripts/miscellaneous/nargchk.m scripts/miscellaneous/news.m scripts/miscellaneous/orderfields.m scripts/miscellaneous/recycle.m scripts/miscellaneous/tar.m scripts/miscellaneous/unix.m scripts/miscellaneous/unpack.m scripts/miscellaneous/untar.m scripts/miscellaneous/unzip.m scripts/miscellaneous/ver.m scripts/miscellaneous/version.m scripts/miscellaneous/what.m scripts/miscellaneous/zip.m scripts/ode/decic.m scripts/optimization/fminbnd.m scripts/optimization/fminunc.m scripts/optimization/fsolve.m scripts/optimization/fzero.m scripts/optimization/glpk.m scripts/optimization/humps.m scripts/optimization/lsqnonneg.m scripts/optimization/optimget.m scripts/optimization/pqpnonneg.m scripts/optimization/sqp.m scripts/path/pathdef.m scripts/plot/appearance/camlookat.m scripts/plot/appearance/hidden.m scripts/plot/appearance/specular.m scripts/plot/draw/plotmatrix.m scripts/plot/draw/smooth3.m scripts/plot/draw/sombrero.m scripts/plot/draw/stemleaf.m scripts/plot/util/__gnuplot_drawnow__.m scripts/plot/util/__opengl_info__.m scripts/plot/util/ancestor.m scripts/plot/util/cla.m scripts/plot/util/close.m scripts/plot/util/closereq.m scripts/plot/util/copyobj.m scripts/plot/util/gca.m scripts/plot/util/gcf.m scripts/plot/util/ginput.m scripts/plot/util/graphics_toolkit.m scripts/plot/util/groot.m scripts/plot/util/hgload.m scripts/plot/util/hgsave.m scripts/plot/util/isgraphics.m scripts/plot/util/ishold.m scripts/plot/util/linkaxes.m scripts/plot/util/meshgrid.m scripts/plot/util/newplot.m scripts/plot/util/refresh.m scripts/plot/util/refreshdata.m scripts/plot/util/rotate.m scripts/plot/util/saveas.m scripts/plot/util/struct2hdl.m scripts/polynomial/conv.m scripts/polynomial/mkpp.m scripts/polynomial/mpoles.m scripts/polynomial/padecoef.m scripts/polynomial/pchip.m scripts/polynomial/polyder.m scripts/polynomial/polyfit.m scripts/polynomial/polygcd.m scripts/polynomial/polyint.m scripts/polynomial/polyout.m scripts/polynomial/polyval.m scripts/polynomial/ppder.m scripts/polynomial/ppint.m scripts/prefs/getpref.m scripts/prefs/ispref.m scripts/prefs/rmpref.m scripts/profiler/profexport.m scripts/profiler/profshow.m scripts/set/powerset.m scripts/signal/arch_fit.m scripts/signal/arma_rnd.m scripts/signal/blackman.m scripts/signal/detrend.m scripts/signal/diffpara.m scripts/signal/fftconv.m scripts/signal/fftfilt.m scripts/signal/filter2.m scripts/signal/freqz.m scripts/signal/freqz_plot.m scripts/signal/hamming.m scripts/signal/hanning.m scripts/signal/sinetone.m scripts/signal/sinewave.m scripts/signal/spectral_adf.m scripts/signal/spectral_xdf.m scripts/signal/stft.m scripts/signal/unwrap.m scripts/sparse/gplot.m scripts/sparse/ichol.m scripts/sparse/ilu.m scripts/sparse/spdiags.m scripts/sparse/sprand.m scripts/sparse/sprandn.m scripts/sparse/spstats.m scripts/sparse/svds.m scripts/sparse/treelayout.m scripts/sparse/treeplot.m scripts/specfun/betainc.m scripts/specfun/betaincinv.m scripts/specfun/ellipke.m scripts/specfun/gammainc.m scripts/specfun/gammaincinv.m scripts/specfun/legendre.m scripts/specfun/pow2.m scripts/special-matrix/hankel.m scripts/special-matrix/pascal.m scripts/special-matrix/rosser.m scripts/special-matrix/toeplitz.m scripts/statistics/bounds.m scripts/statistics/corr.m scripts/statistics/cov.m scripts/statistics/histc.m scripts/statistics/kendall.m scripts/statistics/kurtosis.m scripts/statistics/mad.m scripts/statistics/mode.m scripts/statistics/moment.m scripts/statistics/prctile.m scripts/statistics/quantile.m scripts/statistics/range.m scripts/statistics/ranks.m scripts/statistics/run_count.m scripts/statistics/skewness.m scripts/statistics/spearman.m scripts/statistics/std.m scripts/statistics/var.m scripts/statistics/zscore.m scripts/strings/dec2base.m scripts/strings/dec2bin.m scripts/strings/dec2hex.m scripts/strings/index.m scripts/strings/mat2str.m scripts/strings/native2unicode.m scripts/strings/ostrsplit.m scripts/strings/strjoin.m scripts/strings/strjust.m scripts/strings/strtok.m scripts/strings/substr.m scripts/strings/unicode2native.m scripts/strings/untabify.m scripts/testfun/__debug_octave__.m scripts/testfun/demo.m scripts/testfun/example.m scripts/testfun/fail.m scripts/testfun/oruntests.m scripts/testfun/private/dump_demos.m scripts/testfun/speed.m scripts/testfun/test.m scripts/time/date.m scripts/time/datenum.m scripts/time/datestr.m scripts/time/datevec.m scripts/time/is_leap_year.m scripts/time/now.m scripts/time/weekday.m
diffstat 286 files changed, 407 insertions(+), 654 deletions(-) [+]
line wrap: on
line diff
--- a/examples/code/@FIRfilter/FIRfilter.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/examples/code/@FIRfilter/FIRfilter.m	Thu Sep 24 14:44:58 2020 -0700
@@ -6,10 +6,6 @@
 
 function f = FIRfilter (p)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     p = @polynomial ([1]);
   elseif (! isa (p, "polynomial"))
--- a/examples/code/@FIRfilter/FIRfilter_aggregation.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/examples/code/@FIRfilter/FIRfilter_aggregation.m	Thu Sep 24 14:44:58 2020 -0700
@@ -6,10 +6,6 @@
 
 function f = FIRfilter (p)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     f.polynomial = @polynomial ([1]);
   else
--- a/examples/code/@polynomial/get.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/examples/code/@polynomial/get.m	Thu Sep 24 14:44:58 2020 -0700
@@ -1,6 +1,6 @@
 function val = get (p, prop)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/examples/code/@polynomial/polynomial.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/examples/code/@polynomial/polynomial.m	Thu Sep 24 14:44:58 2020 -0700
@@ -13,10 +13,6 @@
 
 function p = polynomial (a)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     p.poly = 0;
     p = class (p, "polynomial");
--- a/examples/code/@polynomial/polynomial_superiorto.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/examples/code/@polynomial/polynomial_superiorto.m	Thu Sep 24 14:44:58 2020 -0700
@@ -13,10 +13,6 @@
 
 function p = polynomial (a)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     p.poly = [0];
     p = class (p, "polynomial");
--- a/examples/code/polynomial2.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/examples/code/polynomial2.m	Thu Sep 24 14:44:58 2020 -0700
@@ -5,10 +5,6 @@
 
   methods
     function p = polynomial2 (a)
-      if (nargin > 1)
-        print_usage ();
-      endif
-
       if (nargin == 1)
         if (isa (a, "polynomial2"))
           p.poly = a.poly;
--- a/scripts/+matlab/+lang/makeUniqueStrings.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/+matlab/+lang/makeUniqueStrings.m	Thu Sep 24 14:44:58 2020 -0700
@@ -57,7 +57,7 @@
 
 function [uniqstr, ismodified] = makeUniqueStrings (str, ex = {}, maxlength = Inf)
 
-  if (nargin == 0 || nargout > 3)
+  if (nargin == 0)
     print_usage ();
   endif
 
--- a/scripts/+matlab/+net/base64decode.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/+matlab/+net/base64decode.m	Thu Sep 24 14:44:58 2020 -0700
@@ -37,7 +37,7 @@
 
 function out_vec = base64decode (b64_str)
 
-  if (nargin != 1 || nargout > 1)
+  if (nargin != 1)
     print_usage ();
   endif
 
--- a/scripts/+matlab/+net/base64encode.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/+matlab/+net/base64encode.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,7 +36,7 @@
 
 function b64_str = base64encode (in)
 
-  if (nargin != 1 || nargout > 1)
+  if (nargin != 1)
     print_usage ();
   endif
 
--- a/scripts/@ftp/cd.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/@ftp/cd.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function path = cd (f, path)
 
-  if (nargin != 1 && nargin != 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/audio/lin2mu.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/audio/lin2mu.m	Thu Sep 24 14:44:58 2020 -0700
@@ -39,6 +39,10 @@
 
 function y = lin2mu (x, n)
 
+  if (nargin < 1)
+    print_usage ();
+  endif
+
   if (nargin == 1)
     range = max (abs (x (:)));
     if (range <= 1)
@@ -49,12 +53,10 @@
     else
       n = 16;
     endif
-  elseif (nargin == 2)
+  else
     if (n != 0 && n != 8 && n != 16)
       error ("lin2mu: N must be either 0, 8 or 16");
     endif
-  else
-    print_usage ();
   endif
 
   ## Transform real and n-bit format to 16-bit.
--- a/scripts/audio/record.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/audio/record.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,13 +36,7 @@
 ## @seealso{sound, soundsc}
 ## @end deftypefn
 
-function x = record (sec, fs)
-
-  if (nargin == 1)
-    fs = 8000;
-  elseif (nargin != 2)
-    print_usage ();
-  endif
+function x = record (sec, fs = 8000)
 
   if (! (isscalar (sec) && (sec >= 0)))
     error ("record: recording duration SEC must be a non-negative number");
--- a/scripts/audio/sound.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/audio/sound.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,7 +45,7 @@
 
 function sound (y, fs, nbits)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/audio/soundsc.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/audio/soundsc.m	Thu Sep 24 14:44:58 2020 -0700
@@ -51,7 +51,7 @@
 
 function soundsc (y, fs, nbits, yrange)
 
-  if (nargin < 1 || nargin > 4)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/accumarray.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/accumarray.m	Thu Sep 24 14:44:58 2020 -0700
@@ -134,7 +134,7 @@
 
 function A = accumarray (subs, vals, sz = [], func = [], fillval = [], issparse = [])
 
-  if (nargin < 2 || nargin > 6)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/accumdim.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/accumdim.m	Thu Sep 24 14:44:58 2020 -0700
@@ -67,7 +67,7 @@
 
 function A = accumdim (subs, vals, dim, n = 0, func = [], fillval = 0)
 
-  if (nargin < 2 || nargin > 6)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/bitcmp.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/bitcmp.m	Thu Sep 24 14:44:58 2020 -0700
@@ -47,7 +47,7 @@
 
 function C = bitcmp (A, k)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/bitset.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/bitset.m	Thu Sep 24 14:44:58 2020 -0700
@@ -64,7 +64,7 @@
 
 function C = bitset (A, n, val = true)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/cart2pol.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/cart2pol.m	Thu Sep 24 14:44:58 2020 -0700
@@ -74,7 +74,7 @@
 
 function [theta, r, z] = cart2pol (x, y, z = [])
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/celldisp.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/celldisp.m	Thu Sep 24 14:44:58 2020 -0700
@@ -55,7 +55,7 @@
 
 function celldisp (c, name)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/circshift.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/circshift.m	Thu Sep 24 14:44:58 2020 -0700
@@ -74,7 +74,7 @@
 
 function y = circshift (x, n, dim)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/cplxpair.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/cplxpair.m	Thu Sep 24 14:44:58 2020 -0700
@@ -59,7 +59,7 @@
 
 function y = cplxpair (z, tol, dim)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/cumtrapz.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/cumtrapz.m	Thu Sep 24 14:44:58 2020 -0700
@@ -51,7 +51,7 @@
 
 function z = cumtrapz (x, y, dim)
 
-  if (nargin < 1) || (nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/flip.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/flip.m	Thu Sep 24 14:44:58 2020 -0700
@@ -61,7 +61,7 @@
 
 function y = flip (x, dim)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/idivide.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/idivide.m	Thu Sep 24 14:44:58 2020 -0700
@@ -74,7 +74,7 @@
 
 function z = idivide (x, y, op)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/interpft.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/interpft.m	Thu Sep 24 14:44:58 2020 -0700
@@ -43,7 +43,7 @@
 
 function z = interpft (x, n, dim)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/logspace.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/logspace.m	Thu Sep 24 14:44:58 2020 -0700
@@ -74,7 +74,7 @@
 
 function retval = logspace (a, b, n = 50)
 
-  if (nargin != 2 && nargin != 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/pol2cart.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/pol2cart.m	Thu Sep 24 14:44:58 2020 -0700
@@ -72,7 +72,7 @@
 
 function [x, y, z] = pol2cart (theta, r, z = [])
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/polyarea.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/polyarea.m	Thu Sep 24 14:44:58 2020 -0700
@@ -48,7 +48,7 @@
 
 function a = polyarea (x, y, dim)
 
-  if (nargin != 2 && nargin != 3)
+  if (nargin < 2)
     print_usage ();
   elseif (! size_equal (x, y))
     error ("polyarea: X and Y must have the same shape");
--- a/scripts/general/postpad.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/postpad.m	Thu Sep 24 14:44:58 2020 -0700
@@ -44,7 +44,7 @@
 
 function y = postpad (x, l, c, dim)
 
-  if (nargin < 2 || nargin > 4)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/prepad.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/prepad.m	Thu Sep 24 14:44:58 2020 -0700
@@ -44,7 +44,7 @@
 
 function y = prepad (x, l, c, dim)
 
-  if (nargin < 2 || nargin > 4)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/rat.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/rat.m	Thu Sep 24 14:44:58 2020 -0700
@@ -65,7 +65,7 @@
 
 function [n, d] = rat (x, tol)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/rot90.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/rot90.m	Thu Sep 24 14:44:58 2020 -0700
@@ -65,7 +65,7 @@
 
 function B = rot90 (A, k = 1)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/rotdim.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/rotdim.m	Thu Sep 24 14:44:58 2020 -0700
@@ -65,7 +65,7 @@
 
 function y = rotdim (x, n, plane)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/shift.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/shift.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,7 +36,7 @@
 
 function y = shift (x, b, dim)
 
-  if (nargin != 2 && nargin != 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/general/shiftdim.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/shiftdim.m	Thu Sep 24 14:44:58 2020 -0700
@@ -59,7 +59,7 @@
 
 function [y, ns]  = shiftdim (x, n)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/sortrows.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/sortrows.m	Thu Sep 24 14:44:58 2020 -0700
@@ -53,7 +53,7 @@
 
 function [s, i] = sortrows (A, c)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/general/trapz.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/general/trapz.m	Thu Sep 24 14:44:58 2020 -0700
@@ -67,7 +67,7 @@
 
 function z = trapz (x, y, dim)
 
-  if (nargin < 1) || (nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/geometry/dsearch.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/geometry/dsearch.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,7 +35,7 @@
 
 function idx = dsearch (x, y, tri, xi, yi, s)
 
-  if (nargin < 5 || nargin > 6)
+  if (nargin < 5)
     print_usage ();
   endif
 
--- a/scripts/geometry/dsearchn.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/geometry/dsearchn.m	Thu Sep 24 14:44:58 2020 -0700
@@ -39,7 +39,7 @@
 
 function [idx, d] = dsearchn (x, tri, xi, outval)
 
-  if (nargin < 2 || nargin > 4)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/gui/getappdata.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/gui/getappdata.m	Thu Sep 24 14:44:58 2020 -0700
@@ -38,7 +38,7 @@
 
 function value = getappdata (h, name)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/gui/getpixelposition.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/gui/getpixelposition.m	Thu Sep 24 14:44:58 2020 -0700
@@ -44,7 +44,7 @@
 
 function pos = getpixelposition (h, rel_to_fig = false)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/gui/guidata.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/gui/guidata.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function dataout = guidata (h, data)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/gui/guihandles.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/gui/guihandles.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,10 +42,6 @@
 
 function hdata = guihandles (h)
 
-  if (nargin > 2)
-    print_usage ();
-  endif
-
   if (nargin == 1)
     if (! ishghandle (h))
       error ("guidata: H must be a valid object handle");
--- a/scripts/gui/isappdata.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/gui/isappdata.m	Thu Sep 24 14:44:58 2020 -0700
@@ -34,7 +34,7 @@
 
 function valid = isappdata (h, name)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/gui/listfonts.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/gui/listfonts.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,10 +40,6 @@
 
 function fonts = listfonts (h)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 1 && (! ishghandle (h) || ! isprop (h, "fontname")))
     error (['listfonts: H must be a handle to a graphics object ', ...
             'with a "fontname" property']);
--- a/scripts/gui/uigetdir.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/gui/uigetdir.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,10 +41,6 @@
 
 function dirname = uigetdir (init_path = pwd, dialog_name = "Select Directory to Open")
 
-  if (nargin > 2)
-    print_usage ();
-  endif
-
   if (! ischar (init_path) || ! ischar (dialog_name))
     error ("uigetdir: INIT_PATH and DIALOG_NAME must be string arguments");
   endif
--- a/scripts/gui/waitforbuttonpress.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/gui/waitforbuttonpress.m	Thu Sep 24 14:44:58 2020 -0700
@@ -39,10 +39,6 @@
 
 function b = waitforbuttonpress ()
 
-  if (nargin != 0 || nargout > 1)
-    print_usage ();
-  endif
-
   [x, y, k] = ginput (1);
 
   if (nargout == 1)
--- a/scripts/help/__makeinfo__.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/help/__makeinfo__.m	Thu Sep 24 14:44:58 2020 -0700
@@ -67,7 +67,7 @@
 function [retval, status] = __makeinfo__ (text, output_type = "plain text", fsee_also)
 
   ## Check input
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/help/doc.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/help/doc.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,10 +41,6 @@
 
 function retval = doc (function_name)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 1)
     if (! ischar (function_name))
       error ("doc: FUNCTION_NAME must be a string");
--- a/scripts/help/get_first_help_sentence.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/help/get_first_help_sentence.m	Thu Sep 24 14:44:58 2020 -0700
@@ -52,7 +52,7 @@
 
 function [text, status] = get_first_help_sentence (name, max_len = 80)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/image/autumn.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/autumn.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = autumn (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("autumn: N must be a scalar");
     endif
--- a/scripts/image/bone.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/bone.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = bone (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("bone: N must be a scalar");
     endif
--- a/scripts/image/brighten.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/brighten.m	Thu Sep 24 14:44:58 2020 -0700
@@ -46,7 +46,7 @@
 
 function rmap = brighten (arg1, beta)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/image/cmpermute.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/cmpermute.m	Thu Sep 24 14:44:58 2020 -0700
@@ -43,7 +43,7 @@
 
 function [Y, newmap] = cmpermute (X, map, index)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/image/cmunique.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/cmunique.m	Thu Sep 24 14:44:58 2020 -0700
@@ -60,7 +60,7 @@
 
 function [Y, newmap] = cmunique (X, map)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/image/colorcube.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/colorcube.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,12 +42,8 @@
 
   if (nargin == 0)
     n = rows (colormap);
-  elseif (nargin == 1)
-    if (! isscalar (n))
-      error ("colorcube: N must be a scalar");
-    endif
-  else
-    print_usage ();
+  elseif (! isscalar (n))
+    error ("colorcube: N must be a scalar");
   endif
 
   if (n < 9)
--- a/scripts/image/contrast.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/contrast.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,9 +35,7 @@
 
 function cmap = contrast (x, n)
 
-  if (nargin > 2)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     hf = get (0, "currentfigure");
     if (! isempty (hf))
       n = rows (get (hf, "colormap"));
--- a/scripts/image/cool.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/cool.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,9 +35,7 @@
 
 function map = cool (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("cool: N must be a scalar");
     endif
--- a/scripts/image/copper.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/copper.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = copper (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("copper: N must be a scalar");
     endif
--- a/scripts/image/cubehelix.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/cubehelix.m	Thu Sep 24 14:44:58 2020 -0700
@@ -50,9 +50,7 @@
 
 function map = cubehelix (n, start = 0.5, rots = -1.5, hue = 1, gamma = 1)
 
-  if (nargin > 5)
-    print_usage ();
-  elseif (nargin > 0)
+  if (nargin > 0)
     if (! isscalar (n))
       error ("cubehelix: N must be a scalar");
     endif
--- a/scripts/image/flag.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/flag.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = flag (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("flag: N must be a scalar");
     endif
--- a/scripts/image/gray.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/gray.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = gray (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("gray: N must be a scalar");
     endif
--- a/scripts/image/gray2ind.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/gray2ind.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,7 +42,7 @@
 
 function [I, map] = gray2ind (I, n = 64)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (! isreal (I) || issparse (I) || ! ismatrix(I))
     error ("gray2ind: I must be a grayscale or binary image");
--- a/scripts/image/hot.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/hot.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = hot (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("hot: N must be a scalar");
     endif
--- a/scripts/image/hsv.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/hsv.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,9 +40,7 @@
 
 function map = hsv (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("hsv: N must be a scalar");
     endif
--- a/scripts/image/im2double.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/im2double.m	Thu Sep 24 14:44:58 2020 -0700
@@ -57,7 +57,7 @@
 
 function img = im2double (img, im_type)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/image/im2frame.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/im2frame.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function frame = im2frame (x, map = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (ndims (x) > 4)
     error ("im2frame: X and RGB must be a single image");
--- a/scripts/image/imformats.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/imformats.m	Thu Sep 24 14:44:58 2020 -0700
@@ -77,10 +77,6 @@
 
 function varargout = imformats (arg1, arg2, arg3)
 
-  if (nargin > 3)
-    print_usage ();
-  endif
-
   mlock (); # prevent formats to be removed by "clear all"
   persistent formats = default_formats ();
 
--- a/scripts/image/jet.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/jet.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = jet (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("jet: N must be a scalar");
     endif
--- a/scripts/image/lines.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/lines.m	Thu Sep 24 14:44:58 2020 -0700
@@ -38,9 +38,7 @@
 function map = lines (n)
 
   hf = get (groot, "currentfigure");
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("lines: N must be a scalar");
     endif
--- a/scripts/image/ocean.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/ocean.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = ocean (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("ocean: N must be a scalar");
     endif
--- a/scripts/image/pink.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/pink.m	Thu Sep 24 14:44:58 2020 -0700
@@ -38,9 +38,7 @@
 
 function map = pink (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("pink: N must be a scalar");
     endif
--- a/scripts/image/prism.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/prism.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,9 +36,7 @@
 
 function map = prism (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("prism: N must be a scalar");
     endif
--- a/scripts/image/rainbow.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/rainbow.m	Thu Sep 24 14:44:58 2020 -0700
@@ -39,9 +39,7 @@
 
 function map = rainbow (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("rainbow: N must be a scalar");
     endif
--- a/scripts/image/rgbplot.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/rgbplot.m	Thu Sep 24 14:44:58 2020 -0700
@@ -52,7 +52,7 @@
 
 function h = rgbplot (cmap, style = "profile")
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/image/spinmap.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/spinmap.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,9 +42,7 @@
 
 function spinmap (t = 5, inc = 2)
 
-  if (nargin > 2)
-    print_usage ();
-  elseif (ischar (t))
+  if (ischar (t))
     if (strcmpi (t, "inf"))
       t = Inf;
     else
--- a/scripts/image/spring.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/spring.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,9 +35,7 @@
 
 function map = spring (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("spring: N must be a scalar");
     endif
--- a/scripts/image/summer.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/summer.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,9 +35,7 @@
 
 function map = summer (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("summer: N must be a scalar");
     endif
--- a/scripts/image/viridis.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/viridis.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,9 +40,7 @@
 
 function map = viridis (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("viridis: N must be a scalar");
     endif
--- a/scripts/image/white.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/white.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,9 +35,7 @@
 
 function map = white (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("white: N must be a scalar");
     endif
--- a/scripts/image/winter.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/image/winter.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,9 +35,7 @@
 
 function map = winter (n)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isscalar (n))
       error ("winter: N must be a scalar");
     endif
--- a/scripts/io/beep.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/io/beep.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,10 +35,6 @@
 
 function beep ()
 
-  if (nargin != 0)
-    print_usage ();
-  endif
-
   puts ("\a");
 
 endfunction
--- a/scripts/io/importdata.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/io/importdata.m	Thu Sep 24 14:44:58 2020 -0700
@@ -69,7 +69,7 @@
 
 function [output, delimiter, header_rows] = importdata (fname, delimiter = "", header_rows = -1)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/io/is_valid_file_id.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/io/is_valid_file_id.m	Thu Sep 24 14:44:58 2020 -0700
@@ -31,18 +31,18 @@
 
 function retval = is_valid_file_id (fid)
 
+  if (nargin != 1)
+    print_usage ();
+  endif
+
   retval = false;
 
-  if (nargin == 1)
-    try
-      if (isscalar (fid))
-        [file, mode, arch] = fopen (fid);
-        retval = ! isempty (file);
-      endif
-    end_try_catch
-  else
-    print_usage ();
-  endif
+  try
+    if (isscalar (fid))
+      [file, mode, arch] = fopen (fid);
+      retval = ! isempty (file);
+    endif
+  end_try_catch
 
 endfunction
 
--- a/scripts/java/javachk.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/java/javachk.m	Thu Sep 24 14:44:58 2020 -0700
@@ -69,7 +69,7 @@
 
 function msg = javachk (feature, caller = "")
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (! ischar (feature))
     error ("javachk: FEATURE must be a string");
--- a/scripts/java/javaclasspath.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/java/javaclasspath.m	Thu Sep 24 14:44:58 2020 -0700
@@ -62,10 +62,6 @@
 
 function [path1, path2] = javaclasspath (what = "")
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   ## dynamic classpath
   dynamic_path = javaMethod ("getClassPath", "org.octave.ClassHelper");
   dynamic_path_list = ostrsplit (dynamic_path, pathsep ());
--- a/scripts/legacy/findstr.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/legacy/findstr.m	Thu Sep 24 14:44:58 2020 -0700
@@ -61,7 +61,7 @@
              "findstr is obsolete; use strfind instead\n");
   endif
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/legacy/genvarname.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/legacy/genvarname.m	Thu Sep 24 14:44:58 2020 -0700
@@ -114,7 +114,7 @@
              "genvarname is obsolete; use matlab.lang.makeValidName or matlab.lang.makeUniqueStrings instead\n");
   endif
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/legacy/strmatch.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/legacy/strmatch.m	Thu Sep 24 14:44:58 2020 -0700
@@ -70,7 +70,7 @@
              "strmatch is obsolete; use strncmp or strcmp instead\n");
   endif
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/bandwidth.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/bandwidth.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function [lower, upper] = bandwidth (A, type)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/commutation_matrix.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/commutation_matrix.m	Thu Sep 24 14:44:58 2020 -0700
@@ -76,7 +76,7 @@
 
 function k = commutation_matrix (m, n)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   else
     if (! (isscalar (m) && m == fix (m) && m > 0))
--- a/scripts/linear-algebra/cond.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/cond.m	Thu Sep 24 14:44:58 2020 -0700
@@ -53,7 +53,7 @@
 
 function retval = cond (A, p = 2)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/cross.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/cross.m	Thu Sep 24 14:44:58 2020 -0700
@@ -50,7 +50,7 @@
 
 function z = cross (x, y, dim)
 
-  if (nargin != 2 && nargin != 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/isdefinite.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/isdefinite.m	Thu Sep 24 14:44:58 2020 -0700
@@ -49,7 +49,7 @@
 
 function retval = isdefinite (A, tol)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/ishermitian.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/ishermitian.m	Thu Sep 24 14:44:58 2020 -0700
@@ -52,7 +52,7 @@
 
 function retval = ishermitian (A, skewopt = "nonskew", tol = 0)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/issymmetric.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/issymmetric.m	Thu Sep 24 14:44:58 2020 -0700
@@ -51,7 +51,7 @@
 
 function retval = issymmetric (A, skewopt = "nonskew", tol = 0)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/krylov.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/krylov.m	Thu Sep 24 14:44:58 2020 -0700
@@ -71,7 +71,7 @@
     defeps = 1e-12;
   endif
 
-  if (nargin < 3 || nargin > 5)
+  if (nargin < 3)
     print_usage ();
   elseif (nargin < 5)
     ## Default permutation flag.
--- a/scripts/linear-algebra/linsolve.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/linsolve.m	Thu Sep 24 14:44:58 2020 -0700
@@ -77,7 +77,7 @@
 
 function [x, R] = linsolve (A, b, opts)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/logm.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/logm.m	Thu Sep 24 14:44:58 2020 -0700
@@ -52,7 +52,7 @@
 
 function [s, iters] = logm (A, opt_iters = 100)
 
-  if (nargin == 0 || nargin > 2)
+  if (nargin == 0)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/lscov.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/lscov.m	Thu Sep 24 14:44:58 2020 -0700
@@ -60,7 +60,7 @@
 
 function [x, stdx, mse, S] = lscov (A, b, V = [], alg)
 
-  if (nargin < 2 || nargin > 4)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/null.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/null.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function retval = null (A, tol)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (nargin == 2 && strcmp (tol, "r"))
     error ("null: option for rational not yet implemented");
--- a/scripts/linear-algebra/ordeig.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/ordeig.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function lambda = ordeig (A, B)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/orth.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/orth.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,45 +40,41 @@
 
 function retval = orth (A, tol)
 
-  if (nargin == 1 || nargin == 2)
-
-    if (isempty (A))
-      retval = [];
-      return;
-    endif
-
-    [U, S, V] = svd (A);
+  if (nargin < 1)
+    print_usage ();
+  endif
 
-    [rows, cols] = size (A);
-
-    [S_nr, S_nc] = size (S);
+  if (isempty (A))
+    retval = [];
+    return;
+  endif
 
-    if (S_nr == 1 || S_nc == 1)
-      s = S(1);
-    else
-      s = diag (S);
-    endif
+  [U, S, V] = svd (A);
+
+  [rows, cols] = size (A);
+
+  [S_nr, S_nc] = size (S);
 
-    if (nargin == 1)
-      if (isa (A, "single"))
-        tol = max (size (A)) * s (1) * eps ("single");
-      else
-        tol = max (size (A)) * s (1) * eps;
-      endif
-    endif
-
-    rank = sum (s > tol);
+  if (S_nr == 1 || S_nc == 1)
+    s = S(1);
+  else
+    s = diag (S);
+  endif
 
-    if (rank > 0)
-      retval = -U(:, 1:rank);
+  if (nargin == 1)
+    if (isa (A, "single"))
+      tol = max (size (A)) * s (1) * eps ("single");
     else
-      retval = zeros (rows, 0);
+      tol = max (size (A)) * s (1) * eps;
     endif
+  endif
 
-  else
+  rank = sum (s > tol);
 
-    print_usage ();
-
+  if (rank > 0)
+    retval = -U(:, 1:rank);
+  else
+    retval = zeros (rows, 0);
   endif
 
 endfunction
--- a/scripts/linear-algebra/rank.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/rank.m	Thu Sep 24 14:44:58 2020 -0700
@@ -81,6 +81,10 @@
 
 function retval = rank (A, tol)
 
+  if (nargin < 1)
+    print_usage ();
+  endif
+
   if (nargin == 1)
     sigma = svd (A);
     if (isempty (sigma))
@@ -92,11 +96,9 @@
         tolerance = max (size (A)) * sigma (1) * eps;
       endif
     endif
-  elseif (nargin == 2)
+  else
     sigma = svd (A);
     tolerance = tol;
-  else
-    print_usage ();
   endif
 
   retval = sum (sigma > tolerance);
--- a/scripts/linear-algebra/rref.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/rref.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function [A, k] = rref (A, tol)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/linear-algebra/vecnorm.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/linear-algebra/vecnorm.m	Thu Sep 24 14:44:58 2020 -0700
@@ -51,7 +51,7 @@
 
 function n = vecnorm (A, p = 2, dim)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/bunzip2.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/bunzip2.m	Thu Sep 24 14:44:58 2020 -0700
@@ -38,7 +38,7 @@
 
 function filelist = bunzip2 (bzfile, dir = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/citation.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/citation.m	Thu Sep 24 14:44:58 2020 -0700
@@ -47,11 +47,8 @@
 
 function citation (package = "octave")
 
-  if (nargin > 1)
-    print_usage ();
-  else
-    display_info_file ("citation", package, "CITATION");
-  endif
+  ## function takes care of validating PACKAGE input
+  display_info_file ("citation", package, "CITATION");
 
 endfunction
 
@@ -59,4 +56,5 @@
 ## Test input validation
 %!error citation (1, 2)
 %!error <citation: PACKAGE must be a string> citation (1)
-%!error <citation: package .* is not installed> citation ("__NOT_A_VALID_PKG_NAME__")
+%!error <citation: package .* is not installed>
+%! citation ("__NOT_A_VALID_PKG_NAME__");
--- a/scripts/miscellaneous/computer.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/computer.m	Thu Sep 24 14:44:58 2020 -0700
@@ -63,9 +63,7 @@
 
 function [comp, maxsize, endian] = computer (a)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1 && ! strcmpi (a, "arch"))
+  if (nargin == 1 && ! strcmpi (a, "arch"))
     error ('computer: "arch" is only valid argument');
   endif
 
--- a/scripts/miscellaneous/copyfile.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/copyfile.m	Thu Sep 24 14:44:58 2020 -0700
@@ -48,7 +48,7 @@
 
 function [status, msg, msgid] = copyfile (f1, f2, force)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/dir.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/dir.m	Thu Sep 24 14:44:58 2020 -0700
@@ -75,13 +75,7 @@
 ## FIXME: This is quite slow for large directories.
 ##        Perhaps it should be converted to C++?
 
-function retval = dir (directory)
-
-  if (nargin == 0)
-    directory = ".";
-  elseif (nargin > 1)
-    print_usage ();
-  endif
+function retval = dir (directory = ".")
 
   if (! ischar (directory))
     error ("dir: DIRECTORY argument must be a string");
--- a/scripts/miscellaneous/dos.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/dos.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function [status, text] = dos (command, echo_arg)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/fileattrib.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/fileattrib.m	Thu Sep 24 14:44:58 2020 -0700
@@ -85,10 +85,6 @@
 
 function [status, msg, msgid] = fileattrib (file = ".")
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (! ischar (file))
     error ("fileattrib: FILE must be a string");
   endif
--- a/scripts/miscellaneous/gunzip.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/gunzip.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function filelist = gunzip (gzfile, dir = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/inputParser.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/inputParser.m	Thu Sep 24 14:44:58 2020 -0700
@@ -225,7 +225,7 @@
       ##
       ## @end deftypefn
 
-      if (nargin < 2 || nargin > 3)
+      if (nargin < 2)
         print_usage ();
       elseif (numel (this.Optional) || numfields (this.Parameter)
               || numfields (this.Switch))
@@ -264,7 +264,7 @@
       ##
       ## @end deftypefn
 
-      if (nargin < 3 || nargin > 4)
+      if (nargin < 3)
         print_usage ();
       elseif (numfields (this.Parameter) || numfields (this.Switch))
         error (["inputParser.Optional: can't have Optional arguments " ...
@@ -287,7 +287,7 @@
       ##
       ## @end deftypefn
 
-      if (nargin < 3 || nargin > 4)
+      if (nargin < 3)
         print_usage ();
       endif
       this.addParameter (name, def, val);
--- a/scripts/miscellaneous/inputname.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/inputname.m	Thu Sep 24 14:44:58 2020 -0700
@@ -75,7 +75,7 @@
 
 function name = inputname (n, ids_only = true)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/ismac.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/ismac.m	Thu Sep 24 14:44:58 2020 -0700
@@ -31,11 +31,7 @@
 
 function retval = ismac ()
 
-  if (nargin == 0)
-    retval = __octave_config_info__ ("mac");
-  else
-    print_usage ();
-  endif
+  retval = __octave_config_info__ ("mac");
 
 endfunction
 
--- a/scripts/miscellaneous/ispc.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/ispc.m	Thu Sep 24 14:44:58 2020 -0700
@@ -31,11 +31,7 @@
 
 function retval = ispc ()
 
-  if (nargin == 0)
-    retval = __octave_config_info__ ("windows");
-  else
-    print_usage ();
-  endif
+  retval = __octave_config_info__ ("windows");
 
 endfunction
 
--- a/scripts/miscellaneous/isunix.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/isunix.m	Thu Sep 24 14:44:58 2020 -0700
@@ -31,11 +31,7 @@
 
 function retval = isunix ()
 
-  if (nargin == 0)
-    retval = __octave_config_info__ ("unix");
-  else
-    print_usage ();
-  endif
+  retval = __octave_config_info__ ("unix");
 
 endfunction
 
--- a/scripts/miscellaneous/license.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/license.m	Thu Sep 24 14:44:58 2020 -0700
@@ -68,12 +68,8 @@
 
 function [retval, errmsg] = license (cmd, feature, toggle)
 
-  if (nargin > 3)
-    print_usage ();
-  endif
-
-  ## Then only give information about Octave core
   if (nargin == 0)
+    ## then only give information about Octave core
     retval = "GNU General Public License";
     return;
   endif
@@ -82,10 +78,6 @@
 
   switch (tolower (cmd))
     case "inuse"
-      if (nargin > 2)
-        print_usage ();
-      endif
-
       features = features(loaded);
 
       if (nargin > 1)
--- a/scripts/miscellaneous/list_primes.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/list_primes.m	Thu Sep 24 14:44:58 2020 -0700
@@ -34,9 +34,7 @@
 
 function retval = list_primes (n = 25)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (! isreal (n) || ! isscalar (n))
+  if (! isreal (n) || ! isscalar (n))
     error ("list_primes: N must be a real scalar");
   endif
 
--- a/scripts/miscellaneous/methods.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/methods.m	Thu Sep 24 14:44:58 2020 -0700
@@ -46,7 +46,7 @@
 
 function mtds = methods (obj, opt)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/mkdir.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/mkdir.m	Thu Sep 24 14:44:58 2020 -0700
@@ -50,7 +50,7 @@
 
 function [status, msg, msgid] = mkdir (parent, dirname)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/movefile.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/movefile.m	Thu Sep 24 14:44:58 2020 -0700
@@ -54,7 +54,7 @@
 
 function [status, msg, msgid] = movefile (f1, f2, force)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/nargchk.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/nargchk.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function msg = nargchk (minargs, maxargs, nargs, outtype = "string")
 
-  if (nargin < 3 || nargin > 4)
+  if (nargin < 3)
     print_usage ();
   elseif (minargs > maxargs)
     error ("nargchk: MINARGS must be <= MAXARGS");
--- a/scripts/miscellaneous/news.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/news.m	Thu Sep 24 14:44:58 2020 -0700
@@ -37,11 +37,8 @@
 
 function news (package = "octave")
 
-  if (nargin > 1)
-    print_usage ();
-  else
-    display_info_file ("news", package, "NEWS");
-  endif
+  ## function takes care of validating PACKAGE input
+  display_info_file ("news", package, "NEWS");
 
 endfunction
 
--- a/scripts/miscellaneous/orderfields.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/orderfields.m	Thu Sep 24 14:44:58 2020 -0700
@@ -104,7 +104,7 @@
 
 function [sout, p] = orderfields (s1, s2)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/recycle.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/recycle.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,10 +42,6 @@
 
   persistent current_state = "off";
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0 || nargout > 0)
     val = current_state;
   endif
--- a/scripts/miscellaneous/tar.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/tar.m	Thu Sep 24 14:44:58 2020 -0700
@@ -44,7 +44,7 @@
 
 function filelist = tar (tarfile, files, rootdir = ".")
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/unix.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/unix.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function [status, text] = unix (command, echo_arg)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/unpack.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/unpack.m	Thu Sep 24 14:44:58 2020 -0700
@@ -78,7 +78,7 @@
 
 function filelist = unpack (file, dir = [], filetype = "")
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/untar.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/untar.m	Thu Sep 24 14:44:58 2020 -0700
@@ -38,7 +38,7 @@
 
 function filelist = untar (tarfile, dir = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/unzip.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/unzip.m	Thu Sep 24 14:44:58 2020 -0700
@@ -38,7 +38,7 @@
 
 function filelist = unzip (zipfile, dir = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/ver.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/ver.m	Thu Sep 24 14:44:58 2020 -0700
@@ -58,10 +58,6 @@
 
 function retval = ver (package = "")
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargout == 0)
     hg_id = __octave_config_info__ ("hg_id");
 
--- a/scripts/miscellaneous/version.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/version.m	Thu Sep 24 14:44:58 2020 -0700
@@ -72,7 +72,7 @@
 
 function [v, d] = version (feature)
 
-  if (nargin > 1 || ((nargin != 0) && ((nargout > 1) || ! ischar (feature))))
+  if (nargin == 1 && (nargout > 1 || ! ischar (feature)))
     print_usage ();
   endif
 
--- a/scripts/miscellaneous/what.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/what.m	Thu Sep 24 14:44:58 2020 -0700
@@ -73,10 +73,6 @@
 
 function retval = what (dir)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     dir = { pwd() };
   else
--- a/scripts/miscellaneous/zip.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/miscellaneous/zip.m	Thu Sep 24 14:44:58 2020 -0700
@@ -44,7 +44,7 @@
 
 function filelist = zip (zipfile, files, rootdir = ".")
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/ode/decic.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/ode/decic.m	Thu Sep 24 14:44:58 2020 -0700
@@ -97,7 +97,7 @@
                                              y0, fixed_y0, yp0, fixed_yp0,
                                              options)
 
-  if (nargin < 6 || nargin > 7)
+  if (nargin < 6)
     print_usage ();
   endif
 
--- a/scripts/optimization/fminbnd.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/fminbnd.m	Thu Sep 24 14:44:58 2020 -0700
@@ -97,7 +97,7 @@
     return;
   endif
 
-  if (nargin < 2 || nargin > 4)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/optimization/fminunc.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/fminunc.m	Thu Sep 24 14:44:58 2020 -0700
@@ -128,7 +128,7 @@
     return;
   endif
 
-  if (nargin < 2 || nargin > 3 || ! isnumeric (x0))
+  if (nargin < 2 || ! isnumeric (x0))
     print_usage ();
   endif
 
--- a/scripts/optimization/fsolve.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/fsolve.m	Thu Sep 24 14:44:58 2020 -0700
@@ -186,7 +186,7 @@
     return;
   endif
 
-  if (nargin < 2 || nargin > 3 || ! isnumeric (x0))
+  if (nargin < 2 || ! isnumeric (x0))
     print_usage ();
   endif
 
--- a/scripts/optimization/fzero.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/fzero.m	Thu Sep 24 14:44:58 2020 -0700
@@ -134,7 +134,7 @@
     return;
   endif
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/optimization/glpk.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/glpk.m	Thu Sep 24 14:44:58 2020 -0700
@@ -485,7 +485,7 @@
 function [xopt, fmin, errnum, extra] = glpk (c, A, b, lb, ub, ctype, vartype, sense, param)
 
   ## If there is no input output the version and syntax
-  if (nargin < 3 || nargin > 9)
+  if (nargin < 3)
     print_usage ();
   endif
 
--- a/scripts/optimization/humps.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/humps.m	Thu Sep 24 14:44:58 2020 -0700
@@ -63,10 +63,6 @@
 
 function [x, y] = humps (x = [0:0.05:1])
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   y = - 4*( 300*x.^4 - 720*x.^3 + 509*x.^2 - 87*x - 22) ./ ...
           ((10*x.^2 - 6*x + 1).*(20*x.^2 - 36*x + 17));
 
--- a/scripts/optimization/lsqnonneg.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/lsqnonneg.m	Thu Sep 24 14:44:58 2020 -0700
@@ -91,7 +91,7 @@
     return;
   endif
 
-  if (nargin < 2 || nargin > 4)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/optimization/optimget.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/optimget.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,7 +36,7 @@
 
 function retval = optimget (options, parname, default)
 
-  if (nargin < 2 || nargin > 4 || ! isstruct (options) || ! ischar (parname))
+  if (nargin < 2 || ! isstruct (options) || ! ischar (parname))
     print_usage ();
   endif
 
--- a/scripts/optimization/pqpnonneg.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/pqpnonneg.m	Thu Sep 24 14:44:58 2020 -0700
@@ -93,7 +93,7 @@
     return;
   endif
 
-  if (nargin < 2 || nargin > 4)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/optimization/sqp.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/optimization/sqp.m	Thu Sep 24 14:44:58 2020 -0700
@@ -197,7 +197,7 @@
 
   globals = struct (); # data and handles, needed and changed by subfunctions
 
-  if (nargin < 2 || nargin > 8 || nargin == 5)
+  if (nargin < 2 || nargin == 5)
     print_usage ();
   endif
 
--- a/scripts/path/pathdef.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/path/pathdef.m	Thu Sep 24 14:44:58 2020 -0700
@@ -44,10 +44,6 @@
 
 function val = pathdef ()
 
-  if (nargin > 0)
-    print_usage ();
-  endif
-
   ## Locate any project-specific .octaverc file.
   proj_octaverc = fullfile (pwd, ".octaverc");
   if (exist (proj_octaverc, "file"))
--- a/scripts/plot/appearance/camlookat.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/appearance/camlookat.m	Thu Sep 24 14:44:58 2020 -0700
@@ -54,10 +54,6 @@
 
 function camlookat (hh)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     hax = gca ();
     hh = get (hax, "children");
--- a/scripts/plot/appearance/hidden.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/appearance/hidden.m	Thu Sep 24 14:44:58 2020 -0700
@@ -48,9 +48,7 @@
 
 function state = hidden (mode = "toggle")
 
-  if (nargin > 2)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! ischar (mode))
       error ("hidden: MODE must be a string");
     elseif (! any (strcmpi (mode, {"on", "off"})))
--- a/scripts/plot/appearance/specular.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/appearance/specular.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,7 +42,7 @@
 
 function retval = specular (sx, sy, sz, lv, vv, se)
 
-  if (nargin < 5 || nargin > 6)
+  if (nargin < 5)
     print_usage ();
   endif
 
--- a/scripts/plot/draw/plotmatrix.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/draw/plotmatrix.m	Thu Sep 24 14:44:58 2020 -0700
@@ -78,7 +78,7 @@
 
   [bigax2, varargin, nargin] = __plt_get_axis_arg__ ("plotmatrix", varargin{:});
 
-  if (nargin > 3 || nargin < 1)
+  if (nargin < 1 || nargin > 3)
     print_usage ();
   endif
 
--- a/scripts/plot/draw/smooth3.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/draw/smooth3.m	Thu Sep 24 14:44:58 2020 -0700
@@ -65,7 +65,7 @@
 
 function smoothed_data = smooth3 (data, method = "box", sz = 3, std_dev = 0.65)
 
-  if (nargin < 1 || nargin > 4)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/plot/draw/sombrero.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/draw/sombrero.m	Thu Sep 24 14:44:58 2020 -0700
@@ -56,9 +56,7 @@
 
 function [x, y, z] = sombrero (n = 41)
 
-  if (nargin > 2)
-    print_usage ();
-  elseif (n <= 1)
+  if (n <= 1)
     error ("sombrero: number of grid lines N must be greater than 1");
   endif
 
--- a/scripts/plot/draw/stemleaf.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/draw/stemleaf.m	Thu Sep 24 14:44:58 2020 -0700
@@ -130,7 +130,7 @@
   ## other options for the kinds of plots described by Tukey could be
   ## provided.  This may best be left to users.
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/plot/util/__gnuplot_drawnow__.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/__gnuplot_drawnow__.m	Thu Sep 24 14:44:58 2020 -0700
@@ -30,7 +30,7 @@
 
 function __gnuplot_drawnow__ (h, term, file, debug_file)
 
-  if (nargin < 1 || nargin > 4 || nargin == 2)
+  if (nargin < 1 || nargin == 2)
     print_usage ();
   endif
 
--- a/scripts/plot/util/__opengl_info__.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/__opengl_info__.m	Thu Sep 24 14:44:58 2020 -0700
@@ -59,10 +59,6 @@
 
 function retval = __opengl_info__ ()
 
-  if (nargin != 0)
-    print_usage ();
-  endif
-
   [info, msg] = gl_info ();
 
   if (! isempty (msg))
--- a/scripts/plot/util/ancestor.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/ancestor.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,7 +42,7 @@
 
 function p = ancestor (h, type, toplevel)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/plot/util/cla.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/cla.m	Thu Sep 24 14:44:58 2020 -0700
@@ -49,10 +49,6 @@
 
 function cla (hax, do_reset = false)
 
-  if (nargin > 2)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     hax = gca;
   elseif (nargin == 1)
--- a/scripts/plot/util/close.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/close.m	Thu Sep 24 14:44:58 2020 -0700
@@ -63,9 +63,7 @@
 
   figs = [];
 
-  if (nargin > 2)
-    print_usage ();
-  elseif (nargin == 0)
+  if (nargin == 0)
     ## Close current figure.
     ## Can't use gcf because it opens a new plot window if one does not exist.
     figs = get (0, "currentfigure");
--- a/scripts/plot/util/closereq.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/closereq.m	Thu Sep 24 14:44:58 2020 -0700
@@ -34,10 +34,6 @@
 
 function closereq ()
 
-  if (nargin != 0)
-    print_usage ();
-  endif
-
   ## Get current figure, but don't use gcf to avoid creating a new figure.
   cf = get (0, "currentfigure");
   if (isfigure (cf))
--- a/scripts/plot/util/copyobj.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/copyobj.m	Thu Sep 24 14:44:58 2020 -0700
@@ -48,7 +48,7 @@
   othertypes = {"line", "patch", "surface", "image", "text", "uicontrol"};
   alltypes = [partypes othertypes];
 
-  if (! ishghandle (horig) || nargin > 2)
+  if (! ishghandle (horig))
     print_usage ();
   elseif (! ishghandle (hparent))
     hparent = figure (fix (hparent));
--- a/scripts/plot/util/gca.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/gca.m	Thu Sep 24 14:44:58 2020 -0700
@@ -57,13 +57,9 @@
 
 function h = gca ()
 
-  if (nargin == 0)
-    h = get (gcf (), "currentaxes");
-    if (isempty (h))
-      h = axes ();
-    endif
-  else
-    print_usage ();
+  h = get (gcf (), "currentaxes");
+  if (isempty (h))
+    h = axes ();
   endif
 
 endfunction
--- a/scripts/plot/util/gcf.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/gcf.m	Thu Sep 24 14:44:58 2020 -0700
@@ -60,15 +60,11 @@
 
 function h = gcf ()
 
-  if (nargin == 0)
-    h = get (0, "currentfigure");
-    if (isempty (h) || h == 0)
-      ## We only have a root object, so create a new figure object
-      ## and make it the current figure.
-      h = figure ();
-    endif
-  else
-    print_usage ();
+  h = get (0, "currentfigure");
+  if (isempty (h) || h == 0)
+    ## We only have a root object, so create a new figure object
+    ## and make it the current figure.
+    h = figure ();
   endif
 
 endfunction
--- a/scripts/plot/util/ginput.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/ginput.m	Thu Sep 24 14:44:58 2020 -0700
@@ -46,10 +46,6 @@
 
 function varargout = ginput (n = -1)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   ## Create an axis, if necessary.
   fig = gcf ();
   ax = gca ();
--- a/scripts/plot/util/graphics_toolkit.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/graphics_toolkit.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,10 +45,6 @@
 
 function retval = graphics_toolkit (name, hlist = [])
 
-  if (nargin > 2)
-    print_usage ();
-  endif
-
   if (nargout > 0 || nargin == 0)
     retval = get (0, "defaultfigure__graphics_toolkit__");
     ## Handle case where graphics_toolkit has been called before any plotting
--- a/scripts/plot/util/groot.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/groot.m	Thu Sep 24 14:44:58 2020 -0700
@@ -58,10 +58,6 @@
 
 function h = groot ()
 
-  if (nargin != 0)
-    print_usage ();
-  endif
-
   h = 0;
 
 endfunction
--- a/scripts/plot/util/hgload.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/hgload.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,7 +45,7 @@
 function [h, old_prop] = hgload (filename, prop_struct = struct ())
 
   ## Check number of input arguments
-  if (nargin == 0 || nargin > 2)
+  if (nargin == 0)
     print_usage ();
   endif
 
--- a/scripts/plot/util/hgsave.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/hgsave.m	Thu Sep 24 14:44:58 2020 -0700
@@ -61,7 +61,7 @@
 
 function hgsave (h, filename, fmt = "-binary")
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/plot/util/isgraphics.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/isgraphics.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,7 +36,7 @@
 
 function retval = isgraphics (h, type = "")
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/plot/util/ishold.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/ishold.m	Thu Sep 24 14:44:58 2020 -0700
@@ -37,10 +37,6 @@
 
 function retval = ishold (h)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     fig = gcf ();
     ax = get (fig, "currentaxes");
--- a/scripts/plot/util/linkaxes.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/linkaxes.m	Thu Sep 24 14:44:58 2020 -0700
@@ -59,7 +59,7 @@
 
 function linkaxes (hax, optstr = "xy")
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/plot/util/meshgrid.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/meshgrid.m	Thu Sep 24 14:44:58 2020 -0700
@@ -67,7 +67,7 @@
 
 function [xx, yy, zz] = meshgrid (x, y, z)
 
-  if (nargin == 0 || nargin > 3)
+  if (nargin == 0)
     print_usage ();
   endif
 
--- a/scripts/plot/util/newplot.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/newplot.m	Thu Sep 24 14:44:58 2020 -0700
@@ -89,10 +89,6 @@
 
 function hax = newplot (hsave = [])
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   cf = [];
   ca = [];
 
--- a/scripts/plot/util/refresh.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/refresh.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,9 +35,7 @@
 
 function refresh (h)
 
-  if (nargin > 1)
-    print_usage ();
-  elseif (nargin == 1)
+  if (nargin == 1)
     if (! isfigure (h))
       error ("refresh: H must be a valid figure handle");
     endif
--- a/scripts/plot/util/refreshdata.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/refreshdata.m	Thu Sep 24 14:44:58 2020 -0700
@@ -74,14 +74,12 @@
     endif
     if (nargin == 1)
       workspace = "base";
-    elseif (nargin == 2)
+    else
       if (! ischar (workspace)
           || ! any (strcmpi (workspace, {"base", "caller"})))
         error ('refreshdata: WORKSPACE must be "base" or "caller"');
       endif
       workspace = tolower (workspace);
-    else
-      print_usage ();
     endif
   endif
 
--- a/scripts/plot/util/rotate.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/rotate.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,7 +45,7 @@
   ## default origin due to possible differences in the auto-scaling
   ## algorithm between Octave and Matlab.
 
-  if (nargin < 3 || nargin > 4)
+  if (nargin < 3)
     print_usage ();
   endif
 
--- a/scripts/plot/util/saveas.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/saveas.m	Thu Sep 24 14:44:58 2020 -0700
@@ -81,7 +81,7 @@
 
 function saveas (h, filename, fmt)
 
-  if (nargin != 2 && nargin != 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/plot/util/struct2hdl.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/plot/util/struct2hdl.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,12 +45,16 @@
 
 function [h, pout] = struct2hdl (s, p=[], hilev = false)
 
+  if (nargin < 1)
+    print_usage ();
+  endif
+
   fields = {"handle", "type", "children", "properties", "special"};
   partypes = {"root", "figure", "axes", "hggroup"};
   othertypes = {"line", "patch", "scatter", "surface", "image", "text"};
   alltypes = [partypes othertypes];
 
-  if (nargin > 3 || ! isstruct (s))
+  if (! isstruct (s))
     print_usage ();
   elseif (! all (isfield (s, fields)))
     print_usage ();
--- a/scripts/polynomial/conv.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/conv.m	Thu Sep 24 14:44:58 2020 -0700
@@ -54,7 +54,7 @@
 
 function y = conv (a, b, shape = "full")
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/polynomial/mkpp.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/mkpp.m	Thu Sep 24 14:44:58 2020 -0700
@@ -59,7 +59,7 @@
 function pp = mkpp (x, P, d)
 
   ## check number of arguments
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/polynomial/mpoles.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/mpoles.m	Thu Sep 24 14:44:58 2020 -0700
@@ -57,7 +57,7 @@
 
 function [multp, indx] = mpoles (p, tol, reorder)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/polynomial/padecoef.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/padecoef.m	Thu Sep 24 14:44:58 2020 -0700
@@ -91,7 +91,7 @@
 
 function [num, den] = padecoef (T, N = 1)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/polynomial/pchip.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/pchip.m	Thu Sep 24 14:44:58 2020 -0700
@@ -75,7 +75,7 @@
 
 function ret = pchip (x, y, xi)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/polynomial/polyder.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/polyder.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,57 +41,57 @@
 
 function [q, d] = polyder (p, a)
 
-  if (nargin == 1 || nargin == 2)
-    if (! isvector (p))
+  if (nargin < 1)
+    print_usage ();
+  endif
+
+  if (! isvector (p))
+    error ("polyder: argument must be a vector");
+  endif
+  if (nargin == 2)
+    if (! isvector (a))
       error ("polyder: argument must be a vector");
     endif
-    if (nargin == 2)
-      if (! isvector (a))
-        error ("polyder: argument must be a vector");
-      endif
-      if (nargout == 1)
-        ## derivative of p*a returns a single polynomial
-        q = polyder (conv (p, a));
+    if (nargout == 1)
+      ## derivative of p*a returns a single polynomial
+      q = polyder (conv (p, a));
+    else
+      ## derivative of p/a returns numerator and denominator
+      d = conv (a, a);
+      if (numel (p) == 1)
+        q = -p * polyder (a);
+      elseif (numel (a) == 1)
+        q = a * polyder (p);
       else
-        ## derivative of p/a returns numerator and denominator
-        d = conv (a, a);
-        if (numel (p) == 1)
-          q = -p * polyder (a);
-        elseif (numel (a) == 1)
-          q = a * polyder (p);
-        else
-          q = conv (polyder (p), a) - conv (p, polyder (a));
-          q = polyreduce (q);
-        endif
-
-        ## remove common factors from numerator and denominator
-        x = polygcd (q, d);
-        if (length (x) != 1)
-          q = deconv (q, x);
-          d = deconv (d, x);
-        endif
-
-        ## move all the gain into the numerator
-        q /= d(1);
-        d /= d(1);
-      endif
-    else
-      lp = numel (p);
-      if (lp == 1)
-        q = 0;
-        return;
-      elseif (lp == 0)
-        q = [];
-        return;
+        q = conv (polyder (p), a) - conv (p, polyder (a));
+        q = polyreduce (q);
       endif
 
-      ## Force P to be a row vector.
-      p = p(:).';
+      ## remove common factors from numerator and denominator
+      x = polygcd (q, d);
+      if (length (x) != 1)
+        q = deconv (q, x);
+        d = deconv (d, x);
+      endif
 
-      q = p(1:(lp-1)) .* [(lp-1):-1:1];
+      ## move all the gain into the numerator
+      q /= d(1);
+      d /= d(1);
     endif
   else
-    print_usage ();
+    lp = numel (p);
+    if (lp == 1)
+      q = 0;
+      return;
+    elseif (lp == 0)
+      q = [];
+      return;
+    endif
+
+    ## Force P to be a row vector.
+    p = p(:).';
+
+    q = p(1:(lp-1)) .* [(lp-1):-1:1];
   endif
 
 endfunction
--- a/scripts/polynomial/polyfit.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/polyfit.m	Thu Sep 24 14:44:58 2020 -0700
@@ -100,7 +100,7 @@
 
 function [p, s, mu] = polyfit (x, y, n)
 
-  if (nargin < 3 || nargin > 4)
+  if (nargin < 3)
     print_usage ();
   endif
 
--- a/scripts/polynomial/polygcd.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/polygcd.m	Thu Sep 24 14:44:58 2020 -0700
@@ -53,39 +53,42 @@
 
 function x = polygcd (b, a, tol)
 
-  if (nargin == 2 || nargin == 3)
-    if (nargin == 2)
-      if (isa (a, "single") || isa (b, "single"))
-        tol = sqrt (eps ("single"));
-      else
-        tol = sqrt (eps);
-      endif
+  if (nargin < 2)
+    print_usage ();
+  endif
+
+  if (nargin == 2)
+    if (isa (a, "single") || isa (b, "single"))
+      tol = sqrt (eps ("single"));
+    else
+      tol = sqrt (eps);
     endif
-    if (length (a) == 1 || length (b) == 1)
-      if (a == 0)
-        x = b;
-      elseif (b == 0)
-        x = a;
-      else
-        x = 1;
-      endif
+  endif
+  ## FIXME: No input validation of tol if it was user-supplied
+
+
+  if (length (a) == 1 || length (b) == 1)
+    if (a == 0)
+      x = b;
+    elseif (b == 0)
+      x = a;
     else
-      a /= a(1);
-      while (1)
-        [d, r] = deconv (b, a);
-        nz = find (abs (r) > tol);
-        if (isempty (nz))
-          x = a;
-          break;
-        else
-          r = r(nz(1):length(r));
-        endif
-        b = a;
-        a = r / r(1);
-      endwhile
+      x = 1;
     endif
   else
-    print_usage ();
+    a /= a(1);
+    while (1)
+      [d, r] = deconv (b, a);
+      nz = find (abs (r) > tol);
+      if (isempty (nz))
+        x = a;
+        break;
+      else
+        r = r(nz(1):length(r));
+      endif
+      b = a;
+      a = r / r(1);
+    endwhile
   endif
 
 endfunction
--- a/scripts/polynomial/polyint.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/polyint.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,7 +36,7 @@
 
 function retval = polyint (p, k)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/polynomial/polyout.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/polyout.m	Thu Sep 24 14:44:58 2020 -0700
@@ -49,7 +49,7 @@
 
 function y = polyout (c, x)
 
-  if (nargin < 1) || (nargin > 2) || (nargout < 0) || (nargout > 1)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/polynomial/polyval.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/polyval.m	Thu Sep 24 14:44:58 2020 -0700
@@ -48,7 +48,7 @@
 
 function [y, dy] = polyval (p, x, s = [], mu)
 
-  if (nargin < 2 || nargin > 4 || (nargout == 2 && nargin < 3))
+  if (nargin < 2 || (nargout == 2 && nargin < 3))
     print_usage ();
   endif
 
--- a/scripts/polynomial/ppder.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/ppder.m	Thu Sep 24 14:44:58 2020 -0700
@@ -35,7 +35,7 @@
 
 function ppd = ppder (pp, m = 1)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/polynomial/ppint.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/polynomial/ppint.m	Thu Sep 24 14:44:58 2020 -0700
@@ -34,7 +34,7 @@
 
 function ppi = ppint (pp, c)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
   if (! (isstruct (pp) && strcmp (pp.form, "pp")))
--- a/scripts/prefs/getpref.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/prefs/getpref.m	Thu Sep 24 14:44:58 2020 -0700
@@ -55,10 +55,6 @@
 
 function retval = getpref (group, pref, default)
 
-  if (nargin > 3)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     retval = loadprefs ();
   elseif (nargin == 1)
--- a/scripts/prefs/ispref.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/prefs/ispref.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function retval = ispref (group, pref = "")
 
-  if (nargin == 0 || nargin > 2)
+  if (nargin == 0)
     print_usage ();
   endif
 
--- a/scripts/prefs/rmpref.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/prefs/rmpref.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,7 +42,7 @@
 
 function rmpref (group, pref)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (! ischar (group))
     error ("rmpref: GROUP must be a string");
--- a/scripts/profiler/profexport.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/profiler/profexport.m	Thu Sep 24 14:44:58 2020 -0700
@@ -47,7 +47,7 @@
 ## Built-in profiler.
 function profexport (dir, name = "", data)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/profiler/profshow.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/profiler/profshow.m	Thu Sep 24 14:44:58 2020 -0700
@@ -46,10 +46,6 @@
 ## Built-in profiler.
 function profshow (data, n = 20)
 
-  if (nargin > 2)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     data = profile ("info");
   elseif (nargin == 1 && ! isstruct (data))
--- a/scripts/set/powerset.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/set/powerset.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function p = powerset (a, byrows_arg)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/arch_fit.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/arch_fit.m	Thu Sep 24 14:44:58 2020 -0700
@@ -58,7 +58,7 @@
 
 function [a, b] = arch_fit (y, x, p, iter, gamma, a0, b0)
 
-  if (nargin < 3 || nargin == 6 || nargin > 7)
+  if (nargin < 3 || nargin == 6)
     print_usage ();
   endif
 
--- a/scripts/signal/arma_rnd.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/arma_rnd.m	Thu Sep 24 14:44:58 2020 -0700
@@ -47,15 +47,9 @@
 ## is omitted, @var{n} = 100 is used.
 ## @end deftypefn
 
-function x = arma_rnd (a, b, v, t, n)
+function x = arma_rnd (a, b, v, t, n = 100)
 
-  if (nargin == 4)
-    n = 100;
-  elseif (nargin == 5)
-    if (! isscalar (n))
-      error ("arma_rnd: N must be a scalar");
-    endif
-  else
+  if (nargin < 4)
     print_usage ();
   endif
 
@@ -67,6 +61,10 @@
     error ("arma_rnd: T must be a scalar");
   endif
 
+  if (! isscalar (n))
+    error ("arma_rnd: N must be a scalar");
+  endif
+
   ar = length (a);
   br = length (b);
 
--- a/scripts/signal/blackman.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/blackman.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,7 +42,7 @@
 
 function c = blackman (m, opt)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/detrend.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/detrend.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,7 +42,7 @@
 
 function y = detrend (x, p = 1)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/diffpara.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/diffpara.m	Thu Sep 24 14:44:58 2020 -0700
@@ -46,7 +46,7 @@
 
 function [d, dd] = diffpara (x, a, b)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/fftconv.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/fftconv.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function c = fftconv (x, y, n)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/signal/fftfilt.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/fftfilt.m	Thu Sep 24 14:44:58 2020 -0700
@@ -47,7 +47,7 @@
   ## of two larger than N and length(b).  This could result in length
   ## one blocks, but if the user knows better ...
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/signal/filter2.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/filter2.m	Thu Sep 24 14:44:58 2020 -0700
@@ -49,7 +49,7 @@
 
 function y = filter2 (b, x, shape)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
   if (nargin < 3)
--- a/scripts/signal/freqz.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/freqz.m	Thu Sep 24 14:44:58 2020 -0700
@@ -82,7 +82,7 @@
 
 function [h_r, f_r] = freqz (b, a, n, region, Fs)
 
-  if (nargin < 1 || nargin > 5)
+  if (nargin < 1)
     print_usage ();
   elseif (nargin == 1)
     ## Response of an FIR filter.
--- a/scripts/signal/freqz_plot.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/freqz_plot.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,7 +36,7 @@
 
 function freqz_plot (w, h, freq_norm = false)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/signal/hamming.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/hamming.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function c = hamming (m, opt)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/hanning.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/hanning.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function c = hanning (m, opt)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/sinetone.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/sinetone.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,7 +36,7 @@
 
 function retval = sinetone (freq, rate = 8000, sec = 1, ampl = 64)
 
-  if (nargin < 1 || nargin > 4)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/sinewave.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/sinewave.m	Thu Sep 24 14:44:58 2020 -0700
@@ -33,19 +33,21 @@
 ## @seealso{sinetone}
 ## @end deftypefn
 
-function x = sinewave (m, n, d)
+function x = sinewave (m, n, d = 0)
 
-  if (nargin > 0 && nargin < 4)
-    if (nargin < 3)
-      d = 0;
-    endif
-    if (nargin < 2)
-      n = m;
-    endif
-    x = sin (((1 : m) + d - 1) * 2 * pi / n);
-  else
+  if (nargin < 1)
     print_usage ();
   endif
+    
+  ## FIXME: No input validation of M, N, or D
+  if (nargin < 2)
+    n = m;
+  endif
+  if (nargin < 3)
+    d = 0;
+  endif
+
+  x = sin (((1 : m) + d - 1) * 2 * pi / n);
 
 endfunction
 
--- a/scripts/signal/spectral_adf.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/spectral_adf.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function retval = spectral_adf (c, win, b)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/spectral_xdf.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/spectral_xdf.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
 
 function retval = spectral_xdf (x, win, b)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/stft.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/stft.m	Thu Sep 24 14:44:58 2020 -0700
@@ -66,7 +66,7 @@
 
 function [y, c] = stft (x, win_size = 80, inc = 24, num_coef = 64, win_type = 1)
 
-  if (nargin < 1 || nargin > 5)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/signal/unwrap.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/signal/unwrap.m	Thu Sep 24 14:44:58 2020 -0700
@@ -39,7 +39,7 @@
 
 function retval = unwrap (x, tol, dim)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/sparse/gplot.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/gplot.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function [x, y] = gplot (A, xy, line_style)
 
-  if (nargin < 2 || nargin > 3 || nargout > 2)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/sparse/ichol.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/ichol.m	Thu Sep 24 14:44:58 2020 -0700
@@ -160,7 +160,7 @@
 
 function L = ichol (A, opts = struct ())
 
-  if (nargin < 1 || nargin > 2 || nargout > 1)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/sparse/ilu.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/ilu.m	Thu Sep 24 14:44:58 2020 -0700
@@ -168,7 +168,7 @@
 
 function [L, U, P] = ilu (A, opts = struct ())
 
-  if (nargin < 1 || nargin > 2 || (nargout > 3))
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/sparse/spdiags.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/spdiags.m	Thu Sep 24 14:44:58 2020 -0700
@@ -64,7 +64,7 @@
 
 function [B, d] = spdiags (v, d, m, n)
 
-  if (nargin < 1 || nargin > 4)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/sparse/sprand.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/sprand.m	Thu Sep 24 14:44:58 2020 -0700
@@ -49,9 +49,9 @@
 
 function s = sprand (m, n, d, rc)
 
-  if (nargin == 1 )
+  if (nargin == 1)
     s = __sprand__ (m, @rand);
-  elseif ( nargin == 3)
+  elseif (nargin == 3)
     s = __sprand__ (m, n, d, "sprand", @rand);
   elseif (nargin == 4)
     s = __sprand__ (m, n, d, rc, "sprand", @rand);
--- a/scripts/sparse/sprandn.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/sprandn.m	Thu Sep 24 14:44:58 2020 -0700
@@ -49,9 +49,9 @@
 
 function s = sprandn (m, n, d, rc)
 
-  if (nargin == 1 )
+  if (nargin == 1)
     s = __sprand__ (m, @randn);
-  elseif ( nargin == 3)
+  elseif (nargin == 3)
     s = __sprand__ (m, n, d, "sprandn", @randn);
   elseif (nargin == 4)
     s = __sprand__ (m, n, d, rc, "sprandn", @randn);
--- a/scripts/sparse/spstats.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/spstats.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function [count, mean, var] = spstats (S, j)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/sparse/svds.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/svds.m	Thu Sep 24 14:44:58 2020 -0700
@@ -102,7 +102,7 @@
 
   persistent root2 = sqrt (2);
 
-  if (nargin < 1 || nargin > 4)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/sparse/treelayout.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/treelayout.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 function [x_coordinate, y_coordinate, height, s] = ...
                                                  treelayout (tree, permutation)
 
-  if (nargin < 1 || nargin > 2 || nargout > 4)
+  if (nargin < 1)
     print_usage ();
   elseif (! isvector (tree) || rows (tree) != 1 || ! isnumeric (tree)
           || any (tree > length (tree)) || any (tree < 0))
--- a/scripts/sparse/treeplot.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/sparse/treeplot.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,7 +40,7 @@
 
 function treeplot (tree, node_style = "ko", edge_style = "r")
 
-  if (nargin < 1 || nargin > 3 || nargout > 0)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/specfun/betainc.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/specfun/betainc.m	Thu Sep 24 14:44:58 2020 -0700
@@ -74,7 +74,7 @@
 
 function y = betainc (x, a, b, tail = "lower")
 
-  if (nargin < 3 || nargin > 4)
+  if (nargin < 3)
     print_usage ();
   endif
 
--- a/scripts/specfun/betaincinv.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/specfun/betaincinv.m	Thu Sep 24 14:44:58 2020 -0700
@@ -84,7 +84,7 @@
 
 function x = betaincinv (y, a, b, tail = "lower")
 
-  if (nargin < 3 || nargin > 4)
+  if (nargin < 3)
     print_usage ();
   endif
 
--- a/scripts/specfun/ellipke.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/specfun/ellipke.m	Thu Sep 24 14:44:58 2020 -0700
@@ -90,7 +90,7 @@
 
 function [k, e] = ellipke (m, tol = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/specfun/gammainc.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/specfun/gammainc.m	Thu Sep 24 14:44:58 2020 -0700
@@ -95,7 +95,7 @@
 
 function y = gammainc (x, a, tail = "lower")
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/specfun/gammaincinv.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/specfun/gammaincinv.m	Thu Sep 24 14:44:58 2020 -0700
@@ -87,7 +87,7 @@
 
 function x = gammaincinv (y, a, tail = "lower")
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/specfun/legendre.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/specfun/legendre.m	Thu Sep 24 14:44:58 2020 -0700
@@ -167,7 +167,7 @@
 
   persistent warned_overflow = false;
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/specfun/pow2.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/specfun/pow2.m	Thu Sep 24 14:44:58 2020 -0700
@@ -47,12 +47,14 @@
 
 function y = pow2 (f, e)
 
+  if (nargin < 1)
+    print_usage ();
+  endif
+
   if (nargin == 1)
     y = 2 .^ f;
-  elseif (nargin == 2)
+  else
     y = f .* (2 .^ e);
-  else
-    print_usage ();
   endif
 
 endfunction
--- a/scripts/special-matrix/hankel.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/special-matrix/hankel.m	Thu Sep 24 14:44:58 2020 -0700
@@ -56,7 +56,7 @@
 
 function retval = hankel (c, r)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/special-matrix/pascal.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/special-matrix/pascal.m	Thu Sep 24 14:44:58 2020 -0700
@@ -47,7 +47,7 @@
 
 function retval = pascal (n, t = 0)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (! (isscalar (n) && isscalar (t)))
     error ("pascal: N and T must be scalars");
--- a/scripts/special-matrix/rosser.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/special-matrix/rosser.m	Thu Sep 24 14:44:58 2020 -0700
@@ -33,10 +33,6 @@
 
 function retval = rosser ()
 
-  if (nargin != 0)
-    print_usage ();
-  endif
-
   retval = [611,   196,  -192,   407,    -8,   -52,   -49,    29;
             196,   899,   113,  -192,   -71,   -43,    -8,   -44;
            -192,   113,   899,   196,    61,    49,     8,    52;
--- a/scripts/special-matrix/toeplitz.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/special-matrix/toeplitz.m	Thu Sep 24 14:44:58 2020 -0700
@@ -65,7 +65,7 @@
 
 function retval = toeplitz (c, r)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/bounds.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/bounds.m	Thu Sep 24 14:44:58 2020 -0700
@@ -48,7 +48,7 @@
 
 function [s, l] = bounds (x, dim, nanflag = false)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/corr.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/corr.m	Thu Sep 24 14:44:58 2020 -0700
@@ -51,7 +51,7 @@
 
 function retval = corr (x, y = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/cov.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/cov.m	Thu Sep 24 14:44:58 2020 -0700
@@ -79,7 +79,7 @@
 
 function c = cov (x, y = [], opt = 0)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/histc.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/histc.m	Thu Sep 24 14:44:58 2020 -0700
@@ -62,7 +62,7 @@
 
 function [n, idx] = histc (x, edges, dim)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/statistics/kendall.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/kendall.m	Thu Sep 24 14:44:58 2020 -0700
@@ -93,7 +93,7 @@
 
 function tau = kendall (x, y = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/kurtosis.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/kurtosis.m	Thu Sep 24 14:44:58 2020 -0700
@@ -88,7 +88,7 @@
 
 function y = kurtosis (x, flag, dim)
 
-  if (nargin < 1) || (nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/mad.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/mad.m	Thu Sep 24 14:44:58 2020 -0700
@@ -58,7 +58,7 @@
 
 function retval = mad (x, opt = 0, dim)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/mode.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/mode.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,7 +45,7 @@
 
 function [m, f, c] = mode (x, dim)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/moment.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/moment.m	Thu Sep 24 14:44:58 2020 -0700
@@ -130,7 +130,7 @@
 
 function m = moment (x, p, opt1, opt2)
 
-  if (nargin < 2 || nargin > 4)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/statistics/prctile.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/prctile.m	Thu Sep 24 14:44:58 2020 -0700
@@ -46,7 +46,7 @@
 
 function q = prctile (x, p = [], dim)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/quantile.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/quantile.m	Thu Sep 24 14:44:58 2020 -0700
@@ -156,7 +156,7 @@
 
 function q = quantile (x, p = [], dim, method = 5)
 
-  if (nargin < 1 || nargin > 4)
+  if (nargin < 1)
     print_usage ();
   endif
 
@@ -405,7 +405,7 @@
 ## Description: Quantile function of empirical samples
 function inv = __quantile__ (x, p, method = 5)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ("quantile");
   endif
 
--- a/scripts/statistics/range.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/range.m	Thu Sep 24 14:44:58 2020 -0700
@@ -42,7 +42,7 @@
 
 function y = range (x, dim)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/ranks.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/ranks.m	Thu Sep 24 14:44:58 2020 -0700
@@ -53,7 +53,7 @@
 
 function y = ranks (x, dim, rtype = 0)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/run_count.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/run_count.m	Thu Sep 24 14:44:58 2020 -0700
@@ -36,7 +36,7 @@
 
 function retval = run_count (x, n, dim)
 
-  if (nargin != 2 && nargin != 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/statistics/skewness.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/skewness.m	Thu Sep 24 14:44:58 2020 -0700
@@ -87,7 +87,7 @@
 
 function y = skewness (x, flag, dim)
 
-  if (nargin < 1) || (nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/spearman.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/spearman.m	Thu Sep 24 14:44:58 2020 -0700
@@ -68,7 +68,7 @@
 
 function rho = spearman (x, y = [])
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/std.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/std.m	Thu Sep 24 14:44:58 2020 -0700
@@ -70,7 +70,7 @@
 
 function retval = std (x, opt = 0, dim)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/var.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/var.m	Thu Sep 24 14:44:58 2020 -0700
@@ -74,7 +74,7 @@
 
 function retval = var (x, opt = 0, dim)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/statistics/zscore.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/statistics/zscore.m	Thu Sep 24 14:44:58 2020 -0700
@@ -49,7 +49,7 @@
 
 function [z, mu, sigma] = zscore (x, opt = 0, dim)
 
-  if (nargin < 1 || nargin > 3 )
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/strings/dec2base.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/dec2base.m	Thu Sep 24 14:44:58 2020 -0700
@@ -58,7 +58,7 @@
 
 function retval = dec2base (d, base, len)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/strings/dec2bin.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/dec2bin.m	Thu Sep 24 14:44:58 2020 -0700
@@ -57,7 +57,7 @@
 
 function b = dec2bin (d, len)
 
-  if (nargin == 0 || nargin > 2)
+  if (nargin == 0)
     print_usage ();
   endif
 
--- a/scripts/strings/dec2hex.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/dec2hex.m	Thu Sep 24 14:44:58 2020 -0700
@@ -54,7 +54,7 @@
 
 function h = dec2hex (d, len)
 
-  if (nargin == 0 || nargin > 2)
+  if (nargin == 0)
     print_usage ();
   endif
 
--- a/scripts/strings/index.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/index.m	Thu Sep 24 14:44:58 2020 -0700
@@ -48,7 +48,7 @@
 
 function n = index (s, t, direction = "first")
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/strings/mat2str.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/mat2str.m	Thu Sep 24 14:44:58 2020 -0700
@@ -65,7 +65,7 @@
 
 function s = mat2str (x, n = 15, cls = "")
 
-  if (nargin < 1 || nargin > 3 || ! (isnumeric (x) || islogical (x)))
+  if (nargin < 1 || ! (isnumeric (x) || islogical (x)))
     print_usage ();
   elseif (ndims (x) > 2)
     error ("mat2str: X must be two dimensional");
--- a/scripts/strings/native2unicode.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/native2unicode.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,7 +45,7 @@
 
 function utf8_str = native2unicode (native_bytes, codepage = "")
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/strings/ostrsplit.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/ostrsplit.m	Thu Sep 24 14:44:58 2020 -0700
@@ -62,7 +62,7 @@
 
 function cstr = ostrsplit (s, sep, strip_empty = false)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   elseif (! ischar (s) || ! ischar (sep))
     error ("ostrsplit: S and SEP must be string values");
--- a/scripts/strings/strjoin.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/strjoin.m	Thu Sep 24 14:44:58 2020 -0700
@@ -49,11 +49,9 @@
 ## @seealso{strsplit}
 ## @end deftypefn
 
-function rval = strjoin (cstr, delimiter)
+function rval = strjoin (cstr, delimiter = " ")
 
-  if (nargin == 1)
-    delimiter = " ";
-  elseif (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (! (iscellstr (cstr) && (ischar (delimiter) || iscellstr (delimiter))))
     print_usage ();
--- a/scripts/strings/strjust.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/strjust.m	Thu Sep 24 14:44:58 2020 -0700
@@ -51,7 +51,7 @@
 
 function y = strjust (s, pos = "right")
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (! ischar (s) || ndims (s) > 2)
     error ("strjust: S must be a string or 2-D character matrix");
--- a/scripts/strings/strtok.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/strtok.m	Thu Sep 24 14:44:58 2020 -0700
@@ -58,7 +58,7 @@
 
 function [tok, rem] = strtok (str, delim)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   elseif (! (ischar (str) || iscellstr (str)))
     error ("strtok: STR must be a string or cell array of strings.");
--- a/scripts/strings/substr.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/substr.m	Thu Sep 24 14:44:58 2020 -0700
@@ -54,7 +54,7 @@
 
 function t = substr (s, offset, len)
 
-  if (nargin < 2 || nargin > 3)
+  if (nargin < 2)
     print_usage ();
   endif
 
--- a/scripts/strings/unicode2native.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/unicode2native.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,7 +45,7 @@
 
 function native_bytes = unicode2native (utf8_str, codepage = "")
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/strings/untabify.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/strings/untabify.m	Thu Sep 24 14:44:58 2020 -0700
@@ -57,7 +57,7 @@
 
 function s = untabify (t, tw = 8, deblank_arg = false)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   elseif (! (ischar (t) || iscellstr (t)))
     error ("untabify: T must be a string or cellstring");
--- a/scripts/testfun/__debug_octave__.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/testfun/__debug_octave__.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,10 +45,6 @@
 
 function __debug_octave__ (command_string)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     if (ismac ())
       status = system ("lldb --version");
--- a/scripts/testfun/demo.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/testfun/demo.m	Thu Sep 24 14:44:58 2020 -0700
@@ -103,7 +103,7 @@
 
 function demo (name, n = 0)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/testfun/example.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/testfun/example.m	Thu Sep 24 14:44:58 2020 -0700
@@ -45,7 +45,7 @@
 
 function [ex_code, ex_idx] = example (name, n = 0)
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/testfun/fail.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/testfun/fail.m	Thu Sep 24 14:44:58 2020 -0700
@@ -67,7 +67,7 @@
 
 function retval = fail (code, pattern, warning_pattern)
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/testfun/oruntests.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/testfun/oruntests.m	Thu Sep 24 14:44:58 2020 -0700
@@ -41,7 +41,7 @@
   if (nargin == 0)
     dirs = ostrsplit (path (), pathsep ());
     do_class_dirs = true;
-  elseif (nargin == 1)
+  else
     dirs = {canonicalize_file_name(directory)};
     if (isempty (dirs{1}) || ! isfolder (dirs{1}))
       ## Search for directory name in path
@@ -55,8 +55,6 @@
       dirs = {fullname};
     endif
     do_class_dirs = false;
-  else
-    print_usage ();
   endif
 
   for i = 1:numel (dirs)
--- a/scripts/testfun/private/dump_demos.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/testfun/private/dump_demos.m	Thu Sep 24 14:44:58 2020 -0700
@@ -57,10 +57,6 @@
 
 function dump_demos (dirs={"plot/appearance", "plot/draw", "plot/util", "image"}, mfile="dump_plot_demos.m", fmt="png")
 
-  if (nargin > 3)
-    print_usage ();
-  endif
-
   if (ischar (dirs))
     dirs = {dirs};
   elseif (! iscellstr (dirs))
--- a/scripts/testfun/speed.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/testfun/speed.m	Thu Sep 24 14:44:58 2020 -0700
@@ -159,7 +159,7 @@
 ## FIXME: consider two dimensional speedup surfaces for functions like kron.
 function [__order, __test_n, __tnew, __torig] = speed (__f1, __init, __max_n = 100, __f2 = "", __tol = eps)
 
-  if (nargin < 1 || nargin > 6)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/testfun/test.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/testfun/test.m	Thu Sep 24 14:44:58 2020 -0700
@@ -137,7 +137,7 @@
   persistent __signal_file  = ">>>>> ";
   persistent __signal_skip  = "----- ";
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   elseif (! isempty (__name) && ! ischar (__name))
     error ("test: NAME must be a string");
--- a/scripts/time/date.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/time/date.m	Thu Sep 24 14:44:58 2020 -0700
@@ -40,10 +40,6 @@
 
 function retval = date ()
 
-  if (nargin != 0)
-    print_usage ();
-  endif
-
   retval = strftime ("%d-%b-%Y", localtime (time ()));
 
 endfunction
--- a/scripts/time/datenum.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/time/datenum.m	Thu Sep 24 14:44:58 2020 -0700
@@ -109,8 +109,7 @@
   persistent monthstart = [306; 337; 0; 31; 61; 92; 122; 153; 184; 214; 245; 275];
   persistent monthlength = [31; 28; 31; 30; 31; 30; 31; 31; 30; 31; 30; 31];
 
-  if (nargin == 0 || nargin > 6
-      || (nargin > 2 && (ischar (year) || iscellstr (year))))
+  if (nargin == 0 || (nargin > 2 && (ischar (year) || iscellstr (year))))
     print_usage ();
   endif
 
--- a/scripts/time/datestr.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/time/datestr.m	Thu Sep 24 14:44:58 2020 -0700
@@ -175,7 +175,7 @@
     names_d = {"S", "M", "T", "W", "T", "F", "S"};
   endif
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/time/datevec.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/time/datevec.m	Thu Sep 24 14:44:58 2020 -0700
@@ -94,7 +94,7 @@
     std_formats{++nfmt} = "mm/dd/yyyy HH:MM";
   endif
 
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1)
     print_usage ();
   endif
 
--- a/scripts/time/is_leap_year.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/time/is_leap_year.m	Thu Sep 24 14:44:58 2020 -0700
@@ -43,10 +43,6 @@
 
 function retval = is_leap_year (year)
 
-  if (nargin > 1)
-    print_usage ();
-  endif
-
   if (nargin == 0)
     t = clock ();
     year = t(1);
--- a/scripts/time/now.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/time/now.m	Thu Sep 24 14:44:58 2020 -0700
@@ -37,10 +37,6 @@
 
 function t = now ()
 
-  if (nargin != 0)
-    print_usage ();
-  endif
-
   t = datenum (clock ());
 
   ## The following doesn't work (e.g., one hour off on 2005-10-04):
--- a/scripts/time/weekday.m	Thu Sep 24 20:49:43 2020 +0200
+++ b/scripts/time/weekday.m	Thu Sep 24 14:44:58 2020 -0700
@@ -55,7 +55,7 @@
 
 function [d, s] = weekday (d, format = "short")
 
-  if (nargin < 1 || nargin > 2)
+  if (nargin < 1)
     print_usage ();
   endif