|
@@ -1,3 +1,4 @@
|
|
|
|
|
+#include <iostream>
|
|
|
#include "streamConsumer.hh"
|
|
#include "streamConsumer.hh"
|
|
|
#include "curseOutput.hh"
|
|
#include "curseOutput.hh"
|
|
|
#include "params.hh"
|
|
#include "params.hh"
|
|
@@ -21,7 +22,17 @@ void run(Params *params)
|
|
|
|
|
|
|
|
int main(int ac, char **av)
|
|
int main(int ac, char **av)
|
|
|
{
|
|
{
|
|
|
- Params *params = new Params(ac, av);
|
|
|
|
|
|
|
+ Params *params;
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ params = new Params(ac, av);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (std::runtime_error &e)
|
|
|
|
|
+ {
|
|
|
|
|
+ std::cerr << *av << ": " << e.what() << std::endl;
|
|
|
|
|
+ Params::usage(*av);
|
|
|
|
|
+ exit (EXIT_FAILURE);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (params->isValid())
|
|
if (params->isValid())
|
|
|
run(params);
|
|
run(params);
|