omit superfluous {} v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 06 May 2019 16:06:57 +0200
branchv_0
changeset 21 6486334a9f93
parent 20 dccbfd273a5a
child 22 d5e80f15d1f7
omit superfluous {}
src/CLIParser.h
--- a/src/CLIParser.h	Wed May 01 22:17:42 2019 +0200
+++ b/src/CLIParser.h	Mon May 06 16:06:57 2019 +0200
@@ -72,36 +72,33 @@
 		Configuration c;
 		RelationConfiguration currentRelation;
 
-		{
-			for (int i = 0; i < arguments.size();) {
-				string_t option = readNext(arguments, i);
+		for (int i = 0; i < arguments.size();) {
+			string_t option = readNext(arguments, i);
 
-				if (option == OPTION_BEFORE_RECORDS) currentRelation.guileBeforeRecords = readNext(arguments, i);
-				else if (option == OPTION_AFTER_RECORDS) currentRelation.guileAfterRecords = readNext(arguments, i);
-				else if (option == OPTION_FOR_EACH) currentRelation.guileForEach = readNext(arguments, i);
-				else if (option == OPTION_WHERE) currentRelation.guileWhere = readNext(arguments, i);
-				else if (option == OPTION_HAS_MORE_RECORDS) currentRelation.guileHasMoreRecords = readNext(arguments, i);
-				else if (option == OPTION_DROP) currentRelation.drop = true;
-				else if (option == OPTION_INPUT_ATTRIBUTES_APPEND) currentRelation.inputAttributesAppend = true;
-				else if (option == OPTION_INPUT_ATTRIBUTES_PREPEND) currentRelation.inputAttributesPrepend = true;
-				else if (option == OPTION_RELATION) {
-					addRelation(c, currentRelation); // previous relation
-					currentRelation.relation = readNext(arguments, i);
-				} else if (option == OPTION_OUTPUT_ATTRIBUTE) {
-					relpipe::writer::AttributeMetadata attribute;
-					attribute.attributeName = readNext(arguments, i);
-					attribute.typeId = parseTypeId(readNext(arguments, i));
-					currentRelation.writerMetadata.push_back(attribute);
-				} else if (option == OPTION_DEFINE) {
-					DefinitionRecipe definition;
-					definition.name = readNext(arguments, i);
-					definition.type = readNext(arguments, i);
-					definition.value = readNext(arguments, i);
-					if (currentRelation.relation.size()) currentRelation.definitions.push_back(definition);
-					else c.definitions.push_back(definition);
-				} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
-
-			}
+			if (option == OPTION_BEFORE_RECORDS) currentRelation.guileBeforeRecords = readNext(arguments, i);
+			else if (option == OPTION_AFTER_RECORDS) currentRelation.guileAfterRecords = readNext(arguments, i);
+			else if (option == OPTION_FOR_EACH) currentRelation.guileForEach = readNext(arguments, i);
+			else if (option == OPTION_WHERE) currentRelation.guileWhere = readNext(arguments, i);
+			else if (option == OPTION_HAS_MORE_RECORDS) currentRelation.guileHasMoreRecords = readNext(arguments, i);
+			else if (option == OPTION_DROP) currentRelation.drop = true;
+			else if (option == OPTION_INPUT_ATTRIBUTES_APPEND) currentRelation.inputAttributesAppend = true;
+			else if (option == OPTION_INPUT_ATTRIBUTES_PREPEND) currentRelation.inputAttributesPrepend = true;
+			else if (option == OPTION_RELATION) {
+				addRelation(c, currentRelation); // previous relation
+				currentRelation.relation = readNext(arguments, i);
+			} else if (option == OPTION_OUTPUT_ATTRIBUTE) {
+				relpipe::writer::AttributeMetadata attribute;
+				attribute.attributeName = readNext(arguments, i);
+				attribute.typeId = parseTypeId(readNext(arguments, i));
+				currentRelation.writerMetadata.push_back(attribute);
+			} else if (option == OPTION_DEFINE) {
+				DefinitionRecipe definition;
+				definition.name = readNext(arguments, i);
+				definition.type = readNext(arguments, i);
+				definition.value = readNext(arguments, i);
+				if (currentRelation.relation.size()) currentRelation.definitions.push_back(definition);
+				else c.definitions.push_back(definition);
+			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
 
 			addRelation(c, currentRelation); // last relation
 		}