aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPjotr Prins2017-08-02 08:46:58 +0000
committerPjotr Prins2017-08-02 08:46:58 +0000
commit3935ba39d30666dd7d4a831155631847c77b70c4 (patch)
treec45fc682b473618a219e324d5c85b5e1f9361d0c /src/main.cpp
parent84360c191f418bf8682b35e0c8235fcc3bd19a06 (diff)
downloadpangemma-3935ba39d30666dd7d4a831155631847c77b70c4.tar.gz
Massive patch using LLVM coding style. It was generated with:
clang-format -style=LLVM -i *.cpp *.h Please set your editor to replace tabs with spaces and use indentation of 2 spaces.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp104
1 files changed, 57 insertions, 47 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c7f0573..833136c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -16,57 +16,67 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <iostream>
+#include "gemma.h"
#include <fstream>
+#include <iostream>
#include <sstream>
#include <sys/stat.h>
#include <sys/types.h>
-#include "gemma.h"
using namespace std;
-int main(int argc, char * argv[]) {
- GEMMA cGemma;
- PARAM cPar;
-
- if (argc <= 1) {
- cGemma.PrintHeader();
- return EXIT_SUCCESS;
- }
- if (argc==2 && argv[1][0] == '-' && argv[1][1] == 'h') {
- cGemma.PrintHelp(0);
- return EXIT_SUCCESS;
- }
- if (argc==3 && argv[1][0] == '-' && argv[1][1] == 'h') {
- string str;
- str.assign(argv[2]);
- cGemma.PrintHelp(atoi(str.c_str()));
- return EXIT_SUCCESS;
- }
- if (argc==2 && argv[1][0] == '-' && argv[1][1] == 'l') {
- cGemma.PrintLicense();
- return EXIT_SUCCESS;
- }
-
- cGemma.Assign(argc, argv, cPar);
-
- ifstream check_dir((cPar.path_out).c_str());
- if (!check_dir) {
- mkdir((cPar.path_out).c_str(), S_IRWXU|S_IRGRP|S_IROTH);
- }
-
- if (cPar.error==true) {return EXIT_FAILURE;}
-
- if (cPar.mode_silence) {stringstream ss; cout.rdbuf (ss.rdbuf());}
-
- cPar.CheckParam();
-
- if (cPar.error==true) {return EXIT_FAILURE;}
-
- cGemma.BatchRun(cPar);
-
- if (cPar.error==true) {return EXIT_FAILURE;}
-
- cGemma.WriteLog(argc, argv, cPar);
-
- return EXIT_SUCCESS; }
+int main(int argc, char *argv[]) {
+ GEMMA cGemma;
+ PARAM cPar;
+
+ if (argc <= 1) {
+ cGemma.PrintHeader();
+ return EXIT_SUCCESS;
+ }
+ if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'h') {
+ cGemma.PrintHelp(0);
+ return EXIT_SUCCESS;
+ }
+ if (argc == 3 && argv[1][0] == '-' && argv[1][1] == 'h') {
+ string str;
+ str.assign(argv[2]);
+ cGemma.PrintHelp(atoi(str.c_str()));
+ return EXIT_SUCCESS;
+ }
+ if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'l') {
+ cGemma.PrintLicense();
+ return EXIT_SUCCESS;
+ }
+
+ cGemma.Assign(argc, argv, cPar);
+
+ ifstream check_dir((cPar.path_out).c_str());
+ if (!check_dir) {
+ mkdir((cPar.path_out).c_str(), S_IRWXU | S_IRGRP | S_IROTH);
+ }
+
+ if (cPar.error == true) {
+ return EXIT_FAILURE;
+ }
+
+ if (cPar.mode_silence) {
+ stringstream ss;
+ cout.rdbuf(ss.rdbuf());
+ }
+
+ cPar.CheckParam();
+
+ if (cPar.error == true) {
+ return EXIT_FAILURE;
+ }
+
+ cGemma.BatchRun(cPar);
+
+ if (cPar.error == true) {
+ return EXIT_FAILURE;
+ }
+
+ cGemma.WriteLog(argc, argv, cPar);
+
+ return EXIT_SUCCESS;
+}