1 ## Copyright (C) 2011-2012 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/>.
16 function display (inPar)
18 if (inPar.FunctionName)
19 name = inPar.FunctionName(1:end-3);
24 required = arg_list (inPar.Required);
25 optional = arg_list (inPar.Optional);
26 paramvalue = arg_list (inPar.ParamValue);
27 switches = arg_list (inPar.Switch);
29 printf ("Input Parser object with:\n");
30 printf ("CaseSensitive: %s\n", binstr (inPar.CaseSensitive));
31 printf ("StructExpand : %s\n", binstr (inPar.StructExpand));
32 printf ("KeepUnmatched: %s\n", binstr (inPar.KeepUnmatched));
33 printf ("FunctionName : '%s'\n", name);
35 printf ("Required arguments : %s\n", required);
36 printf ("Optional arguments : %s\n", optional);
37 printf ("ParamValue arguments: %s\n", paramvalue);
38 printf ("Switch arguments : %s\n", switches);
42 function [str] = binstr (bin)
50 function [str] = arg_list (args)
51 str = strcat ("'", fieldnames (args), {"', "});
53 str = cstrcat (str{:});
54 str = str(1:end-2); # remove the last comma and space