1 ## Copyright (C) 2011 Carnë Draug <carandraug+dev@gmail.com>
3 ## This program is free software; you can redistribute it and/or modify it under
4 ## the terms of the GNU General Public License as published by the Free Software
5 ## Foundation; either version 3 of the License, or (at your option) any later
8 ## This program is distributed in the hope that it will be useful, but WITHOUT
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 ## You should have received a copy of the GNU General Public License along with
14 ## this program; if not, see <http://www.gnu.org/licenses/>.
17 ## @deftypefn {Function File} {@var{parser} =} addRequired (@var{parser}, @var{argname})
18 ## @deftypefnx {Function File} {@var{parser} =} @var{parser}.addRequired (@var{argname})
19 ## @deftypefnx {Function File} {@var{parser} =} addRequired (@var{parser}, @var{argname}, @var{validator})
20 ## @deftypefnx {Function File} {@var{parser} =} @var{parser}.addRequired (@var{argname}, @var{validator})
21 ## Add new mandatory argument to the object @var{parser} of inputParser class.
23 ## This method belongs to the inputParser class and implements an ordered
24 ## arguments type of API.
26 ## @var{argname} must be a string with the name of the new argument. The order
27 ## in which new arguments are added with @command{addrequired}, represents the
28 ## expected order of arguments.
30 ## @var{validator} is an optional function handle to validate the given values
31 ## for the argument with name @var{argname}. Alternatively, a function name
34 ## See @command{help inputParser} for examples.
36 ## @emph{Note}: this can be used together with the other type of arguments but
37 ## it must be the first (see @command{@@inputParser}).
39 ## @seealso{inputParser, @@inputParser/addOptional, @@inputParser/addParamValue
40 ## @@inputParser/addParamValue, @@inputParser/addSwitch, @@inputParser/parse}
43 function inPar = addRequired (inPar, name, val)
45 ## check @inputParser/subsref for the actual code
47 inPar = subsref (inPar, substruct(
52 inPar = subsref (inPar, substruct(