-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload-net.C
More file actions
44 lines (29 loc) · 869 Bytes
/
Copy pathload-net.C
File metadata and controls
44 lines (29 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# include <tclap/CmdLine.h>
# include <net.H>
bool verbose = false;
using namespace TCLAP;
void process_comand_line(int argc, char *argv[])
{
CmdLine cmd("load-data", ' ', "0.0");
SwitchArg verbose("v", "verbose", "verbose mode", false);
cmd.add(verbose);
SwitchArg test("t", "test", "test for consistency", true);
cmd.add(test);
ValueArg<string> meta("m", "meta-data", "nombre archivo de archivo data",
true, "data.txt",
"nombre de archivo dónde se escribirán los datos");
cmd.add(meta);
cmd.parse(argc, argv);
::verbose = verbose.getValue();
ifstream in(meta.getValue());
if (in.fail())
throw domain_error(fmt("No puedo abrir %s", meta.getValue().c_str()));
MetaMapa mapa(in);
if (test.getValue())
mapa.autotest();
mapa.save(cout);
}
int main(int argc, char *argv[])
{
process_comand_line(argc, argv);
}