/[PAMELA software]/yoda/techmodel/techmodelreader.cpp
ViewVC logotype

Diff of /yoda/techmodel/techmodelreader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6.1 by kusanagi, Wed Mar 8 13:51:45 2006 UTC revision 6.2 by kusanagi, Tue Apr 4 15:26:57 2006 UTC
# Line 52  int main(int argc, char* argv[]) { Line 52  int main(int argc, char* argv[]) {
52    if (argc < 2){    if (argc < 2){
53      //logger->info(_T("You have forgotten the file name."));      //logger->info(_T("You have forgotten the file name."));
54      cout << "You have forgotten the file name. \n";      cout << "You have forgotten the file name. \n";
55      cout << "Try '--help' for more information. \n";      cout << "Try '-help' for more information. \n";
56      exit(1);      exit(1);
57    }      }  
58        
59    if (!strcmp(argv[1], "--help")){    if (!strcmp(argv[1], "-help")){
60          cout << "Usage: yoda FILE [OPTION] \n";          cout << "Usage: yoda FILE [OPTION] \n";
61          cout << "\t --help              print this help and exit \n";          cout << "\t -help               print this help and exit \n";
62            cout << "\t -version            print version number \n";
63          cout << "\t -p                  maximum number of packets to process [default all] \n";          cout << "\t -p                  maximum number of packets to process [default all] \n";
64          cout << "\t -multi              generate multiple root files \n";          cout << "\t -multi              generate multiple root files \n";
65          cout << "\t -c                  set the compression level for the generated root file(s). Values: [0,9] [default = 3]\n";          cout << "\t -c                  set the compression level for the generated root file(s). Values: [0,9] [default = 3]\n";
# Line 66  int main(int argc, char* argv[]) { Line 67  int main(int argc, char* argv[]) {
67          exit(1);          exit(1);
68    }    }
69    
70      if (!strcmp(argv[1], "-version")){
71            cout << "$Name$ $Revision$" << "\n";
72            exit(1);
73      }
74    
75    ifstream from (argv[1]);    ifstream from (argv[1]);
76    if (!from) {    if (!from) {
77      //logger->info(_T("The file does not exist."));      //logger->info(_T("The file does not exist."));
# Line 77  int main(int argc, char* argv[]) { Line 83  int main(int argc, char* argv[]) {
83      if (!strcmp(argv[i], "-p")){      if (!strcmp(argv[i], "-p")){
84          if (++i >= argc){          if (++i >= argc){
85              cerr << "-p needs arguments. \n";              cerr << "-p needs arguments. \n";
86              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
87              exit(1);              exit(1);
88          }          }
89          if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) {          if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) {
# Line 85  int main(int argc, char* argv[]) { Line 91  int main(int argc, char* argv[]) {
91          } else {          } else {
92              //logger->info(_T("The file does not exist."));              //logger->info(_T("The file does not exist."));
93              cerr << "-p needs a integer value. \n";              cerr << "-p needs a integer value. \n";
94              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
95              exit(1);              exit(1);
96          }          }
97          continue;          continue;
# Line 96  int main(int argc, char* argv[]) { Line 102  int main(int argc, char* argv[]) {
102      if (!strcmp(argv[i], "-c")){      if (!strcmp(argv[i], "-c")){
103          if (++i >= argc){          if (++i >= argc){
104              cerr << "-c needs arguments. \n";              cerr << "-c needs arguments. \n";
105              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
106              exit(1);              exit(1);
107          }          }
108          if ((isdigit(*argv[i])) && ( (atoi(argv[i]) >= 0) && (atoi(argv[i]) <= 9))) {          if ((isdigit(*argv[i])) && ( (atoi(argv[i]) >= 0) && (atoi(argv[i]) <= 9))) {
# Line 104  int main(int argc, char* argv[]) { Line 110  int main(int argc, char* argv[]) {
110          } else {          } else {
111              //logger->info(_T("The file does not exist."));              //logger->info(_T("The file does not exist."));
112              cerr << "-c needs a integer value beetween 0 and 9. \n";              cerr << "-c needs a integer value beetween 0 and 9. \n";
113              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
114              exit(1);              exit(1);
115          }          }
116          continue;          continue;
# Line 113  int main(int argc, char* argv[]) { Line 119  int main(int argc, char* argv[]) {
119      if (!strcmp(argv[i], "-o")){      if (!strcmp(argv[i], "-o")){
120          if (++i >= argc){          if (++i >= argc){
121              cerr << "-o needs arguments. \n";              cerr << "-o needs arguments. \n";
122              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
123              exit(1);              exit(1);
124          }          }
125          DIR* tempdir;          DIR* tempdir;
# Line 123  int main(int argc, char* argv[]) { Line 129  int main(int argc, char* argv[]) {
129          } else {          } else {
130              //logger->info(_T("The file does not exist."));              //logger->info(_T("The file does not exist."));
131              cerr << "-o needs an existing/accessable directory. \n";              cerr << "-o needs an existing/accessable directory. \n";
132              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
133              exit(1);              exit(1);
134          }          }
135          continue;          continue;
# Line 181  int main(int argc, char* argv[]) { Line 187  int main(int argc, char* argv[]) {
187    //Momentarly suspended the save      //Momentarly suspended the save  
188    //system(command.c_str());    //system(command.c_str());
189  }  }
190    

Legend:
Removed from v.6.1  
changed lines
  Added in v.6.2

  ViewVC Help
Powered by ViewVC 1.1.23