1 |
|
|
/* |
2 |
|
|
Teem: Tools to process and visualize scientific data and images . |
3 |
|
|
Copyright (C) 2013, 2012, 2011, 2010, 2009 University of Chicago |
4 |
|
|
Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann |
5 |
|
|
Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah |
6 |
|
|
|
7 |
|
|
This library is free software; you can redistribute it and/or |
8 |
|
|
modify it under the terms of the GNU Lesser General Public License |
9 |
|
|
(LGPL) as published by the Free Software Foundation; either |
10 |
|
|
version 2.1 of the License, or (at your option) any later version. |
11 |
|
|
The terms of redistributing and/or modifying this software also |
12 |
|
|
include exceptions to the LGPL that facilitate static linking. |
13 |
|
|
|
14 |
|
|
This library is distributed in the hope that it will be useful, |
15 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 |
|
|
Lesser General Public License for more details. |
18 |
|
|
|
19 |
|
|
You should have received a copy of the GNU Lesser General Public License |
20 |
|
|
along with this library; if not, write to Free Software Foundation, Inc., |
21 |
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
22 |
|
|
*/ |
23 |
|
|
|
24 |
|
|
#include "teem/unrrdu.h" |
25 |
|
|
|
26 |
|
|
/* |
27 |
|
|
** Tests: |
28 |
|
|
*/ |
29 |
|
|
|
30 |
|
|
int |
31 |
|
|
main(int argc, const char **argv) { |
32 |
|
|
const char *me; |
33 |
|
|
airArray *mop; |
34 |
|
|
|
35 |
|
|
hestParm *hparm; |
36 |
|
|
unsigned int uci; |
37 |
|
|
FILE *out; |
38 |
|
|
int ret; |
39 |
|
|
|
40 |
|
|
AIR_UNUSED(argc); |
41 |
|
2 |
out = stdout; |
42 |
|
1 |
me = argv[0]; |
43 |
|
1 |
mop = airMopNew(); |
44 |
|
1 |
hparm = hestParmNew(); |
45 |
|
1 |
airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways); |
46 |
|
|
|
47 |
|
|
/* This just generates all the usage information for unu itself, and then |
48 |
|
|
for all the unu sub-commands. The purpose is to exercise hest's |
49 |
|
|
generation of usage info for all the options, and to make sure (by human |
50 |
|
|
inspection now, later by something automated) that the use of stderr vs |
51 |
|
|
stdout, and return values, is consistent across all commands */ |
52 |
|
|
|
53 |
|
1 |
fprintf(out, "%s: ################### BEGIN unu\n", me); |
54 |
|
1 |
unrrduUsageUnu("unu", hparm); |
55 |
|
1 |
fprintf(out, "%s: ################### END unu\n", me); |
56 |
|
|
|
57 |
|
|
uci = 0; |
58 |
|
1 |
do { |
59 |
|
70 |
fprintf(out, "%s: ################### BEGIN unu %s\n", |
60 |
|
70 |
me, unrrduCmdList[uci]->name); |
61 |
|
70 |
ret = unrrduCmdList[uci]->main(0, NULL, unrrduCmdList[uci]->name, hparm); |
62 |
|
70 |
fprintf(out, "%s: ################### END unu %s (ret=%d)\n", |
63 |
|
70 |
me, unrrduCmdList[uci]->name, ret); |
64 |
|
70 |
uci++; |
65 |
✓✓ |
70 |
} while (unrrduCmdList[uci]); |
66 |
|
|
|
67 |
|
1 |
airMopOkay(mop); |
68 |
|
1 |
return 0; |
69 |
|
|
} |