PageRenderTime 53ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/src/cyad/main.cpp

https://gitlab.com/admin-github-cloud/cynara
C++ | 43 lines | 16 code | 5 blank | 22 comment | 0 complexity | 5735eacb0adac02e6c1addc72af334ce MD5 | raw file
  1. /*
  2. * Copyright (c) 2014-2016 Samsung Electronics Co., Ltd All Rights Reserved
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * @file src/cyad/main.cpp
  18. * @author Aleksander Zdyb <a.zdyb@samsung.com>
  19. * @author Oskar Świtalski <o.switalski@samsung.com>
  20. * @version 1.0
  21. * @brief A command-line tool for managing Cynara's database
  22. */
  23. #include <exception>
  24. #include <iostream>
  25. #include <cyad/Cyad.h>
  26. #include <cynara-error.h>
  27. int main(int argc, char **argv) {
  28. int result = CYNARA_API_UNKNOWN_ERROR;
  29. try {
  30. Cynara::Cyad cyad(argc, argv);
  31. result = cyad.run();
  32. } catch (const std::exception &e) {
  33. std::cerr << "Caught exception: " << e.what() << std::endl;
  34. } catch (...) {
  35. std::cerr << "Caught unknow exception" << std::endl;
  36. }
  37. return result;
  38. }