new CLI interface: rename --pattern to --value v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 11 May 2021 21:10:22 +0200
branchv_0
changeset 26 88e566898f8f
parent 25 98be80d2e65b
child 27 1bf047cc60f5
new CLI interface: rename --pattern to --value because --relation and --attribute are patterns too
bash-completion.sh
src/CLIParser.h
--- a/bash-completion.sh	Tue May 11 20:42:22 2021 +0200
+++ b/bash-completion.sh	Tue May 11 21:10:22 2021 +0200
@@ -35,7 +35,7 @@
 
 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("'.*'")
 	elif [[ "$w1" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("'.*'")
-	elif [[ "$w1" == "--pattern"                       && "x$w0" == "x" ]];    then COMPREPLY=("''")
+	elif [[ "$w1" == "--value"                         && "x$w0" == "x" ]];    then COMPREPLY=("''")
 	elif [[ "$w1" == "--case-sensitive"                                 ]];    then COMPREPLY=($(compgen -W "${ENTITY_VALUES[*]}"  -- "$w0"))
 	elif [[ "$w2" == "--case-sensitive"                                 ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
 	elif [[ "$w1" == "--invert-match"                                   ]];    then COMPREPLY=($(compgen -W "${ENTITY_VALUES[*]}"  -- "$w0"))
@@ -44,7 +44,7 @@
 		OPTIONS=(
 			"--relation"
 			"--attribute"
-			"--pattern"
+			"--value"
 			"--case-sensitive"
 			"--invert-match"
 		)
--- a/src/CLIParser.h	Tue May 11 20:42:22 2021 +0200
+++ b/src/CLIParser.h	Tue May 11 21:10:22 2021 +0200
@@ -67,7 +67,7 @@
 
 	static const relpipe::common::type::StringX OPTION_RELATION;
 	static const relpipe::common::type::StringX OPTION_ATTRIBUTE;
-	static const relpipe::common::type::StringX OPTION_PATTERN;
+	static const relpipe::common::type::StringX OPTION_VALUE;
 	static const relpipe::common::type::StringX OPTION_CASE_SENSITIVE;
 	static const relpipe::common::type::StringX OPTION_INVERT_MATCH;
 
@@ -83,7 +83,7 @@
 				currentRelation.relation = readNext(arguments, i);
 			} else if (option == OPTION_ATTRIBUTE) {
 				currentRelation.attribute = readNext(arguments, i);
-			} else if (option == OPTION_PATTERN) {
+			} else if (option == OPTION_VALUE) {
 				currentRelation.value = readNext(arguments, i);
 			} else if (option == OPTION_CASE_SENSITIVE) {
 				RelationConfiguration::ENTITY entity = parseEntity(readNext(arguments, i));
@@ -104,7 +104,7 @@
 
 const relpipe::common::type::StringX CLIParser::OPTION_RELATION = L"--relation";
 const relpipe::common::type::StringX CLIParser::OPTION_ATTRIBUTE = L"--attribute";
-const relpipe::common::type::StringX CLIParser::OPTION_PATTERN = L"--pattern";
+const relpipe::common::type::StringX CLIParser::OPTION_VALUE = L"--value";
 const relpipe::common::type::StringX CLIParser::OPTION_CASE_SENSITIVE = L"--case-sensitive";
 const relpipe::common::type::StringX CLIParser::OPTION_INVERT_MATCH = L"--invert-match";