int main(int argc, char** argv) { String name = argv[0]; String message = ""; if ((argc > 4) || (argc < 2)) { Usage(argv[0], ""); exit(1); } try { char* repositoryRoot; char* nameSpace = "CIMv2"; if (argc == 4) { repositoryRoot = argv[3]; cout << "repository Root " << repositoryRoot << endl; } else { static char* tmp; tmp = getenv("PEGASUS_HOME"); if (tmp) { repositoryRoot = tmp; } else { Usage(argv[0], "The Environment variable PEGASUS_HOME could not be found"); exit(1); } } cout << "test argc" << argc << endl; if (argc == 2) { nameSpace = argv[2]; } cout << "test xmlfile" << endl; char* xmlFile = argv[1]; cout << argv[0] << " loading " << xmlFile << " to namespace " << nameSpace << " in repository " << repositoryRoot << endl; _processFile(argv[1], nameSpace, repositoryRoot); } catch (Exception& e) { cerr << e.getMessage() << endl; exit(1); } cout << argv[0] << "loaded" << endl; return 0; }
int main(int argc, char** argv) { if (argc != 3) { cerr << "Usage: " << argv[0] << " repository-root xmlfile" << endl; exit(1); } try { _processFile(argv[1], argv[2]); } catch (const Exception& e) { cerr << e.getMessage() << endl; exit(1); } cout << "+++++ passed all tests" << endl; return 0; }
int main(int argc, char** argv) { if (argc < 2) { cerr << "Usage: " << argv[0] << " xml-filename ..." << endl; exit(1); } for (Uint32 i = 1; i < Uint32(argc); i++) { try { _processFile(argv[i]); } catch(Exception& e) { cerr << "Error: " << e.getMessage() << endl; exit(1); } } cout << argv[0] << " +++++ passed all tests" << endl; return 0; }