Merge lp:~paul-lucas/zorba/pjl-misc into lp:zorba
- pjl-misc
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Paul J. Lucas |
Approved revision: | 11423 |
Merged at revision: | 11693 |
Proposed branch: | lp:~paul-lucas/zorba/pjl-misc |
Merge into: | lp:zorba |
Diff against target: |
1010 lines (+449/-472) 5 files modified
bin/CMakeLists.txt (+1/-0) bin/zorbacmdproperties.h (+2/-1) bin/zorbacmdproperties.txt (+28/-28) bin/zorbacmdproperties_base.cpp (+374/-0) bin/zorbacmdproperties_base.h (+44/-443) |
To merge this branch: | bzr merge lp:~paul-lucas/zorba/pjl-misc |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Paul J. Lucas | Approve | ||
Review via email: mp+204361@code.launchpad.net |
Commit message
zorba-cmd clean-up. Why this code is (mostly) duplicated here and inside libzorba isn't clear.
Description of the change
zorba-cmd clean-up. Why this code is (mostly) duplicated here and inside libzorba isn't clear.
Paul J. Lucas (paul-lucas) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "BuildZorbaUbuntu" failed.
Check compiler output at http://
- 11424. By Paul J. Lucas
-
Forgot a file.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting criteria failed for the following merge proposals:
https:/
Votes: {'Approve': 1}
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
Matthias Brantner (matthias-brantner) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue succeeded - proposal merged!
Preview Diff
1 | === modified file 'bin/CMakeLists.txt' | |||
2 | --- bin/CMakeLists.txt 2013-08-09 09:04:36 +0000 | |||
3 | +++ bin/CMakeLists.txt 2014-01-31 23:33:08 +0000 | |||
4 | @@ -45,6 +45,7 @@ | |||
5 | 45 | 45 | ||
6 | 46 | SET(SRCS | 46 | SET(SRCS |
7 | 47 | zorbacmd.cpp | 47 | zorbacmd.cpp |
8 | 48 | zorbacmdproperties_base.cpp | ||
9 | 48 | zorbacmdproperties.cpp | 49 | zorbacmdproperties.cpp |
10 | 49 | util.cpp | 50 | util.cpp |
11 | 50 | path_util.cpp | 51 | path_util.cpp |
12 | 51 | 52 | ||
13 | === modified file 'bin/zorbacmdproperties.h' | |||
14 | --- bin/zorbacmdproperties.h 2013-06-16 00:37:21 +0000 | |||
15 | +++ bin/zorbacmdproperties.h 2014-01-31 23:33:08 +0000 | |||
16 | @@ -122,4 +122,5 @@ | |||
17 | 122 | 122 | ||
18 | 123 | bool loadProperties(int argc, char* argv[]); | 123 | bool loadProperties(int argc, char* argv[]); |
19 | 124 | }; | 124 | }; |
21 | 125 | #endif | 125 | #endif /* ZORBA_CMD_PROPERTIES_H */ |
22 | 126 | /* vim:set et sw=2 ts=2: */ | ||
23 | 126 | 127 | ||
24 | === modified file 'bin/zorbacmdproperties.txt' | |||
25 | --- bin/zorbacmdproperties.txt 2013-08-09 09:04:36 +0000 | |||
26 | +++ bin/zorbacmdproperties.txt 2014-01-31 23:33:08 +0000 | |||
27 | @@ -1,40 +1,40 @@ | |||
38 | 1 | ("timing,t", "Print timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.") | 1 | ("as-files,f", "Treat all -q arguments as file paths instead of URIs or inline queries.") |
29 | 2 | ("output-file,o", po::value<std::string>(), "Write the result to the given file.") | ||
30 | 3 | ("serialization-parameter,z", po::value<std::vector<std::string> >(), "Set serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).") | ||
31 | 4 | ("serialize-html", "Serialize the result as HTML.") | ||
32 | 5 | ("serialize-text", "Serialize the result as Text.") | ||
33 | 6 | ("indent,i", "Indent output.") | ||
34 | 7 | ("print-query", "Print the queries.") | ||
35 | 8 | ("print-errors-as-xml,x", "Print the errors as XML.") | ||
36 | 9 | ("byte-order-mark", "Set the byte-order-mark for the serializer.") | ||
37 | 10 | ("omit-xml-declaration,r", "Omit the XML declaration from the result.") | ||
39 | 11 | ("base-uri", po::value<std::string>(), "Set the base URI property of the static context.") | 2 | ("base-uri", po::value<std::string>(), "Set the base URI property of the static context.") |
40 | 12 | ("boundary-space", po::value<std::string>(), "Set the boundary-space policy ('strip' or 'preserve') in the static context.") | 3 | ("boundary-space", po::value<std::string>(), "Set the boundary-space policy ('strip' or 'preserve') in the static context.") |
42 | 13 | ("default-collation", po::value<std::string>(), "Add the given collation and set the value of the default collation in the static context to the given collation.") | 4 | ("byte-order-mark", "Set the byte-order-mark for the serializer.") |
43 | 5 | ("classpath", po::value<std::string>(), "JVM classpath to be used by modules using Java implementations") | ||
44 | 6 | ("compile-only", "Only compile (don't execute)") | ||
45 | 7 | ("compile-plan,c", "Output the query plan as binary.") | ||
46 | 14 | ("construction-mode", po::value<std::string>(), "Set the construction mode ('strip' or 'preserve') in the static context.") | 8 | ("construction-mode", po::value<std::string>(), "Set the construction mode ('strip' or 'preserve') in the static context.") |
47 | 15 | ("ordering-mode", po::value<std::string>(), "Set the ordering mode ('ordered' or 'unordered') in the static context.") | ||
48 | 16 | ("multiple,m", po::value<unsigned long>()->default_value (1), "Execute the given queries multiple times.") | ||
49 | 17 | ("query,q", po::value<std::vector<std::string> >(&theQueriesOrFiles), "Query test or file URI (file://...)") | ||
50 | 18 | ("as-files,f", "Treat all -q arguments as file paths instead of URIs or inline queries.") | ||
51 | 19 | ("external-variable,e", po::value<std::vector<std::string> >(), "Provide the value for a variable given a file (name=file) or a value (name:=value)") | ||
52 | 20 | ("context-item", po::value<std::string> (), "Set the context item to the XML document in a given file.") | 9 | ("context-item", po::value<std::string> (), "Set the context item to the XML document in a given file.") |
53 | 21 | ("optimization-level", po::value<std::string>()->default_value("O1"), "Optimization level for the query compiler (O0, O1 or O2 - default: O1)") | ||
54 | 22 | ("lib-module,l", "Query compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.") | ||
55 | 23 | ("parse-only", "Stop after parsing the query.") | ||
56 | 24 | ("compile-only", "Only compile (don't execute)") | ||
57 | 25 | ("no-serializer", "Do not serialize (discard) result.") | ||
58 | 26 | ("debug,d", "Launch the Zorba debugger server and connect to a DBGP-enabled debugger client.") | 10 | ("debug,d", "Launch the Zorba debugger server and connect to a DBGP-enabled debugger client.") |
59 | 27 | ("debug-host,h", po::value<std::string>()->default_value("127.0.0.1"), "The host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1") | 11 | ("debug-host,h", po::value<std::string>()->default_value("127.0.0.1"), "The host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1") |
60 | 28 | ("debug-port,p", po::value<unsigned int>()->default_value (28028), "The port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028") | 12 | ("debug-port,p", po::value<unsigned int>()->default_value (28028), "The port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028") |
64 | 29 | ("no-logo", "Print no logo when starting.") | 13 | ("default-collation", po::value<std::string>(), "Add the given collation and set the value of the default collation in the static context to the given collation.") |
65 | 30 | ("timeout", po::value<long>()->default_value(-1), "Specify a timeout in seconds. After the specified time, the execution of the query will be aborted.") | 14 | ("execute-plan", "Take a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.") |
66 | 31 | ("uri-path", po::value<std::string>(), "URI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.") | 15 | ("external-variable,e", po::value<std::vector<std::string> >(), "Provide the value for a variable given a file (name=file) or a value (name:=value)") |
67 | 16 | ("indent,i", "Indent output.") | ||
68 | 17 | ("lib-module,l", "Query compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.") | ||
69 | 32 | ("lib-path", po::value<std::string>(), "Library path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.") | 18 | ("lib-path", po::value<std::string>(), "Library path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.") |
70 | 33 | ("module-path", po::value<std::string>(), "Path (list of directories) to add to both the URI and Library paths.") | 19 | ("module-path", po::value<std::string>(), "Path (list of directories) to add to both the URI and Library paths.") |
72 | 34 | ("classpath", po::value<std::string>(), "JVM classpath to be used by modules using Java implementations") | 20 | ("multiple,m", po::value<unsigned long>()->default_value (1), "Execute the given queries multiple times.") |
73 | 21 | ("no-logo", "Print no logo when starting.") | ||
74 | 22 | ("no-serializer", "Do not serialize (discard) result.") | ||
75 | 23 | ("omit-xml-declaration,r", "Omit the XML declaration from the result.") | ||
76 | 24 | ("optimization-level", po::value<std::string>()->default_value("O1"), "Optimization level for the query compiler (O0, O1 or O2 - default: O1)") | ||
77 | 35 | ("option", po::value<std::vector<std::string> >(), "Set an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://zorba.io/}option=value"). | 25 | ("option", po::value<std::vector<std::string> >(), "Set an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://zorba.io/}option=value"). |
79 | 36 | ("trailing-nl", "Output a trailing newline after the result of the query.") | 26 | ("ordering-mode", po::value<std::string>(), "Set the ordering mode ('ordered' or 'unordered') in the static context.") |
80 | 27 | ("output-file,o", po::value<std::string>(), "Write the result to the given file.") | ||
81 | 28 | ("parse-only", "Stop after parsing the query.") | ||
82 | 29 | ("print-errors-as-xml,x", "Print the errors as XML.") | ||
83 | 30 | ("print-query", "Print the queries.") | ||
84 | 31 | ("query,q", po::value<std::vector<std::string> >(&theQueriesOrFiles), "Query test or file URI (file://...)") | ||
85 | 32 | ("serialization-parameter,z", po::value<std::vector<std::string> >(), "Set serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).") | ||
86 | 33 | ("serialize-html", "Serialize the result as HTML.") | ||
87 | 34 | ("serialize-text", "Serialize the result as Text.") | ||
88 | 37 | ("stop-words", po::value<std::vector<std::string> >(), "Mapping specifying a stop-words URI to another.") | 35 | ("stop-words", po::value<std::vector<std::string> >(), "Mapping specifying a stop-words URI to another.") |
89 | 38 | ("thesaurus", po::value<std::vector<std::string> >(), "Mapping specifying a thesaurus URI to another.") | 36 | ("thesaurus", po::value<std::vector<std::string> >(), "Mapping specifying a thesaurus URI to another.") |
92 | 39 | ("compile-plan,c", "Output the query plan as binary.") | 37 | ("timeout", po::value<long>()->default_value(-1), "Specify a timeout in seconds. After the specified time, the execution of the query will be aborted.") |
93 | 40 | ("execute-plan", "Take a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.") | 38 | ("timing,t", "Print timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.") |
94 | 39 | ("trailing-nl", "Output a trailing newline after the result of the query.") | ||
95 | 40 | ("uri-path", po::value<std::string>(), "URI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.") | ||
96 | 41 | 41 | ||
97 | === added file 'bin/zorbacmdproperties_base.cpp' | |||
98 | --- bin/zorbacmdproperties_base.cpp 1970-01-01 00:00:00 +0000 | |||
99 | +++ bin/zorbacmdproperties_base.cpp 2014-01-31 23:33:08 +0000 | |||
100 | @@ -0,0 +1,374 @@ | |||
101 | 1 | /* | ||
102 | 2 | * Copyright 2006-2008 The FLWOR Foundation. | ||
103 | 3 | * | ||
104 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
105 | 5 | * you may not use this file except in compliance with the License. | ||
106 | 6 | * You may obtain a copy of the License at | ||
107 | 7 | * | ||
108 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
109 | 9 | * | ||
110 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
111 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
112 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
113 | 13 | * See the License for the specific language governing permissions and | ||
114 | 14 | * limitations under the License. | ||
115 | 15 | */ | ||
116 | 16 | |||
117 | 17 | #include "zorbacmdproperties_base.h" | ||
118 | 18 | |||
119 | 19 | namespace zorbacmd { | ||
120 | 20 | |||
121 | 21 | /////////////////////////////////////////////////////////////////////////////// | ||
122 | 22 | |||
123 | 23 | ZorbaCMDPropertiesBase::ZorbaCMDPropertiesBase() { | ||
124 | 24 | theAsFiles = true; | ||
125 | 25 | theByteOrderMark = false; | ||
126 | 26 | theCompileOnly = false; | ||
127 | 27 | theDebug = false; | ||
128 | 28 | theDebugHost = "127.0.0.1"; | ||
129 | 29 | theDebugPort = 28028; | ||
130 | 30 | theFparm = false; | ||
131 | 31 | theIndent = false; | ||
132 | 32 | theLibModule = false; | ||
133 | 33 | theLoadPlan = false; | ||
134 | 34 | theMultiple = 1; | ||
135 | 35 | theNoLogo = false; | ||
136 | 36 | theNoSerializer = false; | ||
137 | 37 | theOmitXmlDeclaration = false; | ||
138 | 38 | theOptimizationLevel = "O1"; | ||
139 | 39 | theParseOnly = false; | ||
140 | 40 | thePrintErrorsAsXml = false; | ||
141 | 41 | thePrintQuery = false; | ||
142 | 42 | theQBeforeF = false; | ||
143 | 43 | theSavePlan = false; | ||
144 | 44 | theSerializeHtml = false; | ||
145 | 45 | theSerializePlan = false; | ||
146 | 46 | theSerializeText = false; | ||
147 | 47 | theTimeout = -1; | ||
148 | 48 | theTiming = false; | ||
149 | 49 | theTrailingNl = false; | ||
150 | 50 | theUnknownOption = false; | ||
151 | 51 | } | ||
152 | 52 | |||
153 | 53 | char const** ZorbaCMDPropertiesBase::get_all_options() const { | ||
154 | 54 | static const char* result [] = { | ||
155 | 55 | "--as-files", | ||
156 | 56 | "--base-uri", | ||
157 | 57 | "--boundary-space", | ||
158 | 58 | "--byte-order-mark", | ||
159 | 59 | "--classpath", | ||
160 | 60 | "--compile-only", | ||
161 | 61 | "--compile-plan", | ||
162 | 62 | "--construction-mode", | ||
163 | 63 | "--context-item", | ||
164 | 64 | "--debug", | ||
165 | 65 | "--debug-host", | ||
166 | 66 | "--debug-port", | ||
167 | 67 | "--default-collation", | ||
168 | 68 | "--disable-http-resolution", | ||
169 | 69 | "--execute-plan", | ||
170 | 70 | "--external-variable", | ||
171 | 71 | "--indent", | ||
172 | 72 | "--lib-module", | ||
173 | 73 | "--lib-path", | ||
174 | 74 | "--module-path", | ||
175 | 75 | "--multiple", | ||
176 | 76 | "--no-logo", | ||
177 | 77 | "--no-serializer", | ||
178 | 78 | "--omit-xml-declaration", | ||
179 | 79 | "--optimization-level", | ||
180 | 80 | "--option", | ||
181 | 81 | "--ordering-mode", | ||
182 | 82 | #ifdef ZORBA_WITH_FILE_ACCESS | ||
183 | 83 | "--output-file", | ||
184 | 84 | #endif /* ZORBA_WITH_FILE_ACCESS */ | ||
185 | 85 | "--parse-only", | ||
186 | 86 | "--print-errors-as-xml", | ||
187 | 87 | "--print-query", | ||
188 | 88 | "--query", | ||
189 | 89 | "--serialization-parameter", | ||
190 | 90 | "--serialize-html", | ||
191 | 91 | "--serialize-plan", | ||
192 | 92 | "--serialize-text", | ||
193 | 93 | "--stop-words", | ||
194 | 94 | "--thesaurus", | ||
195 | 95 | "--timeout", | ||
196 | 96 | "--timing", | ||
197 | 97 | "--trailing-nl", | ||
198 | 98 | "--uri-path", | ||
199 | 99 | NULL | ||
200 | 100 | }; | ||
201 | 101 | return result; | ||
202 | 102 | } | ||
203 | 103 | |||
204 | 104 | #define IS_LONG_OPT(OPT) (strcmp( *argv, (OPT) ) == 0) | ||
205 | 105 | #define IS_SHORT_OPT(OPT) (strncmp( *argv, (OPT), 2 ) == 0) | ||
206 | 106 | #define IS_OPT(LOPT,SOPT) (IS_LONG_OPT(LOPT) || IS_SHORT_OPT(SOPT)) | ||
207 | 107 | |||
208 | 108 | std::string ZorbaCMDPropertiesBase::load_argv(int argc, const char **argv) { | ||
209 | 109 | if ( !argv ) | ||
210 | 110 | return ""; | ||
211 | 111 | |||
212 | 112 | std::string result; | ||
213 | 113 | for ( ++argv; *argv; ++argv ) { | ||
214 | 114 | if ( IS_OPT( "--help", "-h" ) ) | ||
215 | 115 | return "!HELP"; | ||
216 | 116 | if ( IS_OPT( "--version", "-v" ) ) | ||
217 | 117 | return "!VER"; | ||
218 | 118 | |||
219 | 119 | if ( IS_OPT( "--as-files", "-f" ) ) { | ||
220 | 120 | theFparm = true; | ||
221 | 121 | theAsFiles = true; | ||
222 | 122 | } | ||
223 | 123 | else if ( IS_LONG_OPT( "--base-uri" ) ) { | ||
224 | 124 | int d = 2; | ||
225 | 125 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
226 | 126 | if (!*argv) { result = "No value given for --base-uri option"; break; } | ||
227 | 127 | init_val(*argv, theBaseUri, d); | ||
228 | 128 | } | ||
229 | 129 | else if ( IS_LONG_OPT( "--boundary-space" ) ) { | ||
230 | 130 | int d = 2; | ||
231 | 131 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
232 | 132 | if (!*argv) { result = "No value given for --boundary-space option"; break; } | ||
233 | 133 | init_val(*argv, theBoundarySpace, d); | ||
234 | 134 | } | ||
235 | 135 | else if ( IS_LONG_OPT( "--byte-order-mark" ) ) | ||
236 | 136 | theByteOrderMark = true; | ||
237 | 137 | else if ( IS_LONG_OPT( "--classpath" ) ) { | ||
238 | 138 | int d = 2; | ||
239 | 139 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
240 | 140 | if (!*argv) { result = "No value given for --classpath option"; break; } | ||
241 | 141 | init_val(*argv, theClasspath, d); | ||
242 | 142 | } | ||
243 | 143 | else if ( IS_LONG_OPT( "--compile-only" ) ) | ||
244 | 144 | theCompileOnly = true; | ||
245 | 145 | else if ( IS_LONG_OPT( "--compile-plan" ) ) | ||
246 | 146 | theSavePlan = true; | ||
247 | 147 | else if ( IS_LONG_OPT( "--construction-mode" ) ) { | ||
248 | 148 | int d = 2; | ||
249 | 149 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
250 | 150 | if (!*argv) { result = "No value given for --construction-mode option"; break; } | ||
251 | 151 | init_val(*argv, theConstructionMode, d); | ||
252 | 152 | } | ||
253 | 153 | else if ( IS_LONG_OPT( "--context-item" ) ) { | ||
254 | 154 | int d = 2; | ||
255 | 155 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
256 | 156 | if (!*argv) { result = "No value given for --context-item option"; break; } | ||
257 | 157 | init_val(*argv, theContextItem, d); | ||
258 | 158 | } | ||
259 | 159 | else if ( IS_OPT( "--debug", "-d" ) ) | ||
260 | 160 | theDebug = true; | ||
261 | 161 | else if ( IS_OPT( "--debug-host", "-h" ) ) { | ||
262 | 162 | int d = 2; | ||
263 | 163 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
264 | 164 | if (!*argv) { result = "No value given for --debug-host option"; break; } | ||
265 | 165 | init_val(*argv, theDebugHost, d); | ||
266 | 166 | } | ||
267 | 167 | else if ( IS_OPT( "--debug-port", "-p" ) ) { | ||
268 | 168 | int d = 2; | ||
269 | 169 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
270 | 170 | if (!*argv) { result = "No value given for --debug-port option"; break; } | ||
271 | 171 | init_val(*argv, theDebugPort, d); | ||
272 | 172 | } | ||
273 | 173 | else if ( IS_LONG_OPT( "--default-collation" ) ) { | ||
274 | 174 | int d = 2; | ||
275 | 175 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
276 | 176 | if (!*argv) { result = "No value given for --default-collation option"; break; } | ||
277 | 177 | init_val(*argv, theDefaultCollation, d); | ||
278 | 178 | } | ||
279 | 179 | else if ( IS_LONG_OPT( "--execute-plan" ) ) | ||
280 | 180 | theLoadPlan = true; | ||
281 | 181 | else if ( IS_OPT( "--external-variable", "-e" ) ) { | ||
282 | 182 | int d = 2; | ||
283 | 183 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
284 | 184 | if (!*argv) { result = "No value given for --external-variable option"; break; } | ||
285 | 185 | init_val(*argv, theExternalVariable, d); | ||
286 | 186 | } | ||
287 | 187 | else if ( IS_OPT( "--indent", "-i" ) ) | ||
288 | 188 | theIndent = true; | ||
289 | 189 | else if ( IS_OPT( "--lib-module", "-l" ) ) | ||
290 | 190 | theLibModule = true; | ||
291 | 191 | else if ( IS_LONG_OPT( "--lib-path" ) ) { | ||
292 | 192 | int d = 2; | ||
293 | 193 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
294 | 194 | if (!*argv) { result = "No value given for --lib-path option"; break; } | ||
295 | 195 | init_val(*argv, theLibPath, d); | ||
296 | 196 | } | ||
297 | 197 | else if ( IS_LONG_OPT( "--module-path" ) ) { | ||
298 | 198 | int d = 2; | ||
299 | 199 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
300 | 200 | if (!*argv) { result = "No value given for --module-path option"; break; } | ||
301 | 201 | init_val(*argv, theModulePath, d); | ||
302 | 202 | } | ||
303 | 203 | else if ( IS_LONG_OPT( "--no-logo" ) ) | ||
304 | 204 | theNoLogo = true; | ||
305 | 205 | else if ( IS_LONG_OPT( "--no-serializer" ) ) | ||
306 | 206 | theNoSerializer = true; | ||
307 | 207 | else if ( IS_OPT( "--multiple", "-m" ) ) { | ||
308 | 208 | int d = 2; | ||
309 | 209 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
310 | 210 | if (!*argv) { result = "No value given for --multiple option"; break; } | ||
311 | 211 | init_val(*argv, theMultiple, d); | ||
312 | 212 | } | ||
313 | 213 | else if ( IS_OPT( "--omit-xml-declaration", "-r" ) ) | ||
314 | 214 | theOmitXmlDeclaration = true; | ||
315 | 215 | else if ( IS_LONG_OPT( "--optimization-level" ) ) { | ||
316 | 216 | int d = 2; | ||
317 | 217 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
318 | 218 | if (!*argv) { result = "No value given for --optimization-level option"; break; } | ||
319 | 219 | init_val(*argv, theOptimizationLevel, d); | ||
320 | 220 | } | ||
321 | 221 | else if ( IS_LONG_OPT( "--option" ) ) { | ||
322 | 222 | int d = 2; | ||
323 | 223 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
324 | 224 | if (!*argv) { result = "No value given for --option option"; break; } | ||
325 | 225 | init_val(*argv, theOption, d); | ||
326 | 226 | } | ||
327 | 227 | else if ( IS_LONG_OPT( "--ordering-mode" ) ) { | ||
328 | 228 | int d = 2; | ||
329 | 229 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
330 | 230 | if (!*argv) { result = "No value given for --ordering-mode option"; break; } | ||
331 | 231 | init_val(*argv, theOrderingMode, d); | ||
332 | 232 | } | ||
333 | 233 | #ifdef ZORBA_WITH_FILE_ACCESS | ||
334 | 234 | else if ( IS_OPT( "--output-file", "-o" ) ) { | ||
335 | 235 | int d = 2; | ||
336 | 236 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
337 | 237 | if (!*argv) { result = "No value given for --output-file option"; break; } | ||
338 | 238 | init_val(*argv, theOutputFile, d); | ||
339 | 239 | } | ||
340 | 240 | #endif /* ZORBA_WITH_FILE_ACCESS */ | ||
341 | 241 | else if ( IS_LONG_OPT( "--parse-only" ) ) | ||
342 | 242 | theParseOnly = true; | ||
343 | 243 | else if ( IS_OPT( "--print-errors-as-xml", "-x" ) ) | ||
344 | 244 | thePrintErrorsAsXml = true; | ||
345 | 245 | else if ( IS_LONG_OPT( "--print-query" ) ) | ||
346 | 246 | thePrintQuery = true; | ||
347 | 247 | else if ( IS_OPT( "--query", "-q" ) ) { | ||
348 | 248 | int d = 2; | ||
349 | 249 | if(theFparm == false) | ||
350 | 250 | theAsFiles = false; | ||
351 | 251 | if(*(argv+1) && !strncmp(*(argv+1), "-f", 2)) | ||
352 | 252 | { | ||
353 | 253 | theQBeforeF = true; // is it "-q -f <filename>" perhaps? | ||
354 | 254 | break; // stop functionality here | ||
355 | 255 | } | ||
356 | 256 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
357 | 257 | if (!*argv) { result = "No value given for --query option"; break; } | ||
358 | 258 | init_val(*argv, theQueriesOrFiles, d); | ||
359 | 259 | } | ||
360 | 260 | else if ( IS_LONG_OPT( "--serialize-html" ) ) | ||
361 | 261 | theSerializeHtml = true; | ||
362 | 262 | else if ( IS_LONG_OPT( "--serialize-text" ) ) | ||
363 | 263 | theSerializeText = true; | ||
364 | 264 | else if ( IS_OPT( "--serialization-parameter", "-z" ) ) { | ||
365 | 265 | int d = 2; | ||
366 | 266 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
367 | 267 | if (!*argv) { result = "No value given for --serialization-parameter option"; break; } | ||
368 | 268 | init_val(*argv, theSerializationParameter, d); | ||
369 | 269 | } | ||
370 | 270 | else if ( IS_LONG_OPT( "--stop-words" ) ) { | ||
371 | 271 | int d = 2; | ||
372 | 272 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
373 | 273 | if (!*argv) { result = "No value given for --stop-words option"; break; } | ||
374 | 274 | init_val(*argv, theStopWords, d); | ||
375 | 275 | } | ||
376 | 276 | else if ( IS_OPT( "--timing", "-t" ) ) | ||
377 | 277 | theTiming = true; | ||
378 | 278 | else if ( IS_LONG_OPT( "--timeout" ) ) { | ||
379 | 279 | int d = 2; | ||
380 | 280 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
381 | 281 | if (!*argv) { result = "No value given for --timeout option"; break; } | ||
382 | 282 | init_val(*argv, theTimeout, d); | ||
383 | 283 | } | ||
384 | 284 | else if ( IS_LONG_OPT( "--trailing-nl" ) ) | ||
385 | 285 | theTrailingNl = true; | ||
386 | 286 | else if ( IS_LONG_OPT( "--uri-path" ) ) { | ||
387 | 287 | int d = 2; | ||
388 | 288 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
389 | 289 | if (!*argv) { result = "No value given for --uri-path option"; break; } | ||
390 | 290 | init_val(*argv, theUriPath, d); | ||
391 | 291 | } | ||
392 | 292 | else if ( IS_OPT( "--serialize-plan", "-s" ) ) | ||
393 | 293 | theSerializePlan = true; | ||
394 | 294 | else if ( IS_LONG_OPT( "--disable-http-resolution" ) ) { | ||
395 | 295 | init_val("{http://zorba.io/options/features}disable=http-uri-resolution", | ||
396 | 296 | theOption, 0); | ||
397 | 297 | } | ||
398 | 298 | else if ( IS_LONG_OPT( "--thesaurus" ) ) { | ||
399 | 299 | int d = 2; | ||
400 | 300 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
401 | 301 | if (!*argv) { result = "No value given for --thesaurus option"; break; } | ||
402 | 302 | init_val(*argv, theThesaurus, d); | ||
403 | 303 | } | ||
404 | 304 | |||
405 | 305 | else if ( IS_LONG_OPT( "--" ) ) { | ||
406 | 306 | copy_args (++argv); | ||
407 | 307 | break; | ||
408 | 308 | } else if ( (*argv)[0] == '-' ) { | ||
409 | 309 | result = "unknown command line option "; result += *argv; | ||
410 | 310 | theUnknownOption = true; break; | ||
411 | 311 | } else { | ||
412 | 312 | init_val(*argv, theQueriesOrFiles, 0); | ||
413 | 313 | copy_args( argv ); | ||
414 | 314 | } | ||
415 | 315 | } // for | ||
416 | 316 | return result; | ||
417 | 317 | } | ||
418 | 318 | |||
419 | 319 | char const* ZorbaCMDPropertiesBase::get_help_msg() const { | ||
420 | 320 | return | ||
421 | 321 | "--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries. This option is deprecated and will be defaulted to true in the future, so any entry in the command line is going to be treated as files.\n\n" | ||
422 | 322 | "--base-uri\nSet the base URI property of the static context.\n\n" | ||
423 | 323 | "--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n" | ||
424 | 324 | "--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n" | ||
425 | 325 | "--classpath\nJVM classpath to be used by modules using Java implementations\n\n" | ||
426 | 326 | "--compile-only\nOnly compile (don't execute)\n\n" | ||
427 | 327 | "--compile-plan,\nDo not execute the query; just compile it and save the execution plan in the file specified with the -o option.\n\n" | ||
428 | 328 | "--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n" | ||
429 | 329 | "--context-item\nSet the context item to the XML document in a given file.\n\n" | ||
430 | 330 | "--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n" | ||
431 | 331 | "--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n" | ||
432 | 332 | "--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n" | ||
433 | 333 | "--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n" | ||
434 | 334 | "--disable-http-resolution\nDo not use HTTP to resolve URIs\n\n" | ||
435 | 335 | "--execute-plan\nDo not compile the query; instead load the execution plan from the file specified by the -f -q options (or by any file specified without any other argument), and execute the loaded plan.\n\n" | ||
436 | 336 | "--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n" | ||
437 | 337 | "--indent, -i\nIndent output.\n\n" | ||
438 | 338 | "--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n" | ||
439 | 339 | "--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n" | ||
440 | 340 | "--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n" | ||
441 | 341 | "--multiple, -m\nExecute the given queries multiple times.\n\n" | ||
442 | 342 | "--no-logo\nPrint no logo when starting.\n\n" | ||
443 | 343 | "--no-serializer\nDo not serialize (discard) result.\n\n" | ||
444 | 344 | "--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n" | ||
445 | 345 | "--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n" | ||
446 | 346 | "--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://zorba.io/}option=value\n\n" | ||
447 | 347 | "--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n" | ||
448 | 348 | "--output-file, -o\nWrite the result to the given file.\n\n" | ||
449 | 349 | "--parse-only\nStop after parsing the query.\n\n" | ||
450 | 350 | "--print-errors-as-xml, -x\nPrint the errors as XML.\n\n" | ||
451 | 351 | "--print-query\nPrint the queries.\n\n" | ||
452 | 352 | "--query, -q\nQuery test or file URI (file://...)\n\n" | ||
453 | 353 | "--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n" | ||
454 | 354 | "--serialize-html\nSerialize the result as HTML.\n\n" | ||
455 | 355 | "--serialize-plan, -s\nSerialize and then load the query execution plan.\n\n" | ||
456 | 356 | "--serialize-text\nSerialize the result as Text.\n\n" | ||
457 | 357 | "--stop-words\nMapping specifying a stop-words URI to another.\n\n" | ||
458 | 358 | "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n" | ||
459 | 359 | "--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n" | ||
460 | 360 | "--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n" | ||
461 | 361 | "--trailing-nl\nOutput a trailing newline after the result of the query.\n\n" | ||
462 | 362 | "--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n" | ||
463 | 363 | ; | ||
464 | 364 | } | ||
465 | 365 | |||
466 | 366 | ZorbaCMDPropertiesBase const* ZorbaCMDPropertiesBase::instance() { | ||
467 | 367 | static ZorbaCMDPropertiesBase result; | ||
468 | 368 | return &result; | ||
469 | 369 | } | ||
470 | 370 | |||
471 | 371 | /////////////////////////////////////////////////////////////////////////////// | ||
472 | 372 | |||
473 | 373 | } // namespace zorbacmd | ||
474 | 374 | /* vim:set et sw=2 ts=2: */ | ||
475 | 0 | 375 | ||
476 | === modified file 'bin/zorbacmdproperties_base.h' | |||
477 | --- bin/zorbacmdproperties_base.h 2013-08-09 09:04:36 +0000 | |||
478 | +++ bin/zorbacmdproperties_base.h 2014-01-31 23:33:08 +0000 | |||
479 | @@ -13,7 +13,6 @@ | |||
480 | 13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
481 | 14 | * limitations under the License. | 14 | * limitations under the License. |
482 | 15 | */ | 15 | */ |
483 | 16 | /* vim:set et sw=2 ts=2: */ | ||
484 | 17 | 16 | ||
485 | 18 | #include <string> | 17 | #include <string> |
486 | 19 | #include <sstream> | 18 | #include <sstream> |
487 | @@ -23,34 +22,12 @@ | |||
488 | 23 | 22 | ||
489 | 24 | #ifndef ZORBACMD_ZORBACMDPROPERTIESBASE | 23 | #ifndef ZORBACMD_ZORBACMDPROPERTIESBASE |
490 | 25 | #define ZORBACMD_ZORBACMDPROPERTIESBASE | 24 | #define ZORBACMD_ZORBACMDPROPERTIESBASE |
496 | 26 | namespace zorbacmd | 25 | namespace zorbacmd { |
497 | 27 | { | 26 | |
498 | 28 | 27 | /////////////////////////////////////////////////////////////////////////////// | |
499 | 29 | class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase | 28 | |
500 | 30 | { | 29 | class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase { |
501 | 31 | protected: | 30 | protected: |
502 | 32 | const char** get_all_options () const | ||
503 | 33 | { | ||
504 | 34 | static const char* result [] = { | ||
505 | 35 | "--timing", | ||
506 | 36 | #ifdef ZORBA_WITH_FILE_ACCESS | ||
507 | 37 | "--output-file", | ||
508 | 38 | #endif /* ZORBA_WITH_FILE_ACCESS */ | ||
509 | 39 | "--serialization-parameter", | ||
510 | 40 | "--serialize-html", "--serialize-text", "--indent", "--print-query", | ||
511 | 41 | "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration", | ||
512 | 42 | "--base-uri", "--boundary-space", "--default-collation", | ||
513 | 43 | "--construction-mode", "--ordering-mode", "--multiple", "--query", | ||
514 | 44 | "--as-files", "--external-variable", "--context-item", | ||
515 | 45 | "--optimization-level", "--lib-module", "--parse-only", "--compile-only", | ||
516 | 46 | "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo", | ||
517 | 47 | "--timeout", "--uri-path", "--lib-path", "--module-path", "--classpath", | ||
518 | 48 | "--option", "--trailing-nl", "--stop-words", "--thesaurus", | ||
519 | 49 | "--compile-plan", "--execute-plan", "--serialize-plan", | ||
520 | 50 | "--disable-http-resolution", NULL }; | ||
521 | 51 | return result; | ||
522 | 52 | } | ||
523 | 53 | |||
524 | 54 | bool theTiming; | 31 | bool theTiming; |
525 | 55 | #ifdef ZORBA_WITH_FILE_ACCESS | 32 | #ifdef ZORBA_WITH_FILE_ACCESS |
526 | 56 | std::string theOutputFile; | 33 | std::string theOutputFile; |
527 | @@ -98,444 +75,68 @@ | |||
528 | 98 | bool theQBeforeF; | 75 | bool theQBeforeF; |
529 | 99 | bool theUnknownOption; | 76 | bool theUnknownOption; |
530 | 100 | 77 | ||
561 | 101 | void initialize () | 78 | // inherited |
562 | 102 | { | 79 | const char** get_all_options() const; |
533 | 103 | theTiming = false; | ||
534 | 104 | theSerializeHtml = false; | ||
535 | 105 | theSerializeText = false; | ||
536 | 106 | theIndent = false; | ||
537 | 107 | thePrintQuery = false; | ||
538 | 108 | thePrintErrorsAsXml = false; | ||
539 | 109 | theByteOrderMark = false; | ||
540 | 110 | theOmitXmlDeclaration = false; | ||
541 | 111 | theMultiple = 1; | ||
542 | 112 | theAsFiles = true; | ||
543 | 113 | theOptimizationLevel = "O1"; | ||
544 | 114 | theLibModule = false; | ||
545 | 115 | theParseOnly = false; | ||
546 | 116 | theCompileOnly = false; | ||
547 | 117 | theNoSerializer = false; | ||
548 | 118 | theDebug = false; | ||
549 | 119 | theDebugHost = "127.0.0.1"; | ||
550 | 120 | theDebugPort = 28028; | ||
551 | 121 | theNoLogo = false; | ||
552 | 122 | theTimeout = -1; | ||
553 | 123 | theTrailingNl = false; | ||
554 | 124 | theSerializePlan = false; | ||
555 | 125 | theSavePlan = false; | ||
556 | 126 | theLoadPlan = false; | ||
557 | 127 | theFparm = false; | ||
558 | 128 | theQBeforeF = false; | ||
559 | 129 | theUnknownOption = false; | ||
560 | 130 | } | ||
563 | 131 | 80 | ||
564 | 132 | public: | 81 | public: |
566 | 133 | const bool &timing () const { return theTiming; } | 82 | ZorbaCMDPropertiesBase(); |
567 | 83 | |||
568 | 84 | bool timing () const { return theTiming; } | ||
569 | 134 | #ifdef ZORBA_WITH_FILE_ACCESS | 85 | #ifdef ZORBA_WITH_FILE_ACCESS |
570 | 135 | const std::string &outputFile () const { return theOutputFile; } | 86 | const std::string &outputFile () const { return theOutputFile; } |
571 | 136 | #endif /* ZORBA_WITH_FILE_ACCESS */ | 87 | #endif /* ZORBA_WITH_FILE_ACCESS */ |
572 | 137 | const std::vector<std::string> &serializationParameter () const { return theSerializationParameter; } | 88 | const std::vector<std::string> &serializationParameter () const { return theSerializationParameter; } |
580 | 138 | const bool &serializeHtml () const { return theSerializeHtml; } | 89 | bool serializeHtml () const { return theSerializeHtml; } |
581 | 139 | const bool &serializeText () const { return theSerializeText; } | 90 | bool serializeText () const { return theSerializeText; } |
582 | 140 | const bool &indent () const { return theIndent; } | 91 | bool indent () const { return theIndent; } |
583 | 141 | const bool &printQuery () const { return thePrintQuery; } | 92 | bool printQuery () const { return thePrintQuery; } |
584 | 142 | const bool &printErrorsAsXml () const { return thePrintErrorsAsXml; } | 93 | bool printErrorsAsXml () const { return thePrintErrorsAsXml; } |
585 | 143 | const bool &byteOrderMark () const { return theByteOrderMark; } | 94 | bool byteOrderMark () const { return theByteOrderMark; } |
586 | 144 | const bool &omitXmlDeclaration () const { return theOmitXmlDeclaration; } | 95 | bool omitXmlDeclaration () const { return theOmitXmlDeclaration; } |
587 | 145 | const std::string &baseUri () const { return theBaseUri; } | 96 | const std::string &baseUri () const { return theBaseUri; } |
588 | 146 | const std::string &boundarySpace () const { return theBoundarySpace; } | 97 | const std::string &boundarySpace () const { return theBoundarySpace; } |
589 | 147 | const std::string &defaultCollation () const { return theDefaultCollation; } | 98 | const std::string &defaultCollation () const { return theDefaultCollation; } |
590 | 148 | const std::string &constructionMode () const { return theConstructionMode; } | 99 | const std::string &constructionMode () const { return theConstructionMode; } |
591 | 149 | const std::string &orderingMode () const { return theOrderingMode; } | 100 | const std::string &orderingMode () const { return theOrderingMode; } |
593 | 150 | const unsigned long &multiple () const { return theMultiple; } | 101 | unsigned long multiple () const { return theMultiple; } |
594 | 151 | const std::vector<std::string> &query () const { return theQueriesOrFiles; } | 102 | const std::vector<std::string> &query () const { return theQueriesOrFiles; } |
596 | 152 | const bool &asFiles () const { return theAsFiles; } | 103 | bool asFiles () const { return theAsFiles; } |
597 | 153 | const std::vector<std::string> &externalVariable () const { return theExternalVariable; } | 104 | const std::vector<std::string> &externalVariable () const { return theExternalVariable; } |
598 | 154 | const std::string &contextItem () const { return theContextItem; } | 105 | const std::string &contextItem () const { return theContextItem; } |
599 | 155 | const std::string &optimizationLevel () const { return theOptimizationLevel; } | 106 | const std::string &optimizationLevel () const { return theOptimizationLevel; } |
605 | 156 | const bool &libModule () const { return theLibModule; } | 107 | bool libModule () const { return theLibModule; } |
606 | 157 | const bool &parseOnly () const { return theParseOnly; } | 108 | bool parseOnly () const { return theParseOnly; } |
607 | 158 | const bool &compileOnly () const { return theCompileOnly; } | 109 | bool compileOnly () const { return theCompileOnly; } |
608 | 159 | const bool &noSerializer () const { return theNoSerializer; } | 110 | bool noSerializer () const { return theNoSerializer; } |
609 | 160 | const bool &debug () const { return theDebug; } | 111 | bool debug () const { return theDebug; } |
610 | 161 | const std::string &debugHost () const { return theDebugHost; } | 112 | const std::string &debugHost () const { return theDebugHost; } |
613 | 162 | const unsigned int &debugPort () const { return theDebugPort; } | 113 | unsigned debugPort () const { return theDebugPort; } |
614 | 163 | const bool &noLogo () const { return theNoLogo; } | 114 | bool noLogo () const { return theNoLogo; } |
615 | 164 | const long &timeout () const { return theTimeout; } | 115 | const long &timeout () const { return theTimeout; } |
616 | 165 | const std::string &uriPath () const { return theUriPath; } | 116 | const std::string &uriPath () const { return theUriPath; } |
617 | 166 | const std::string &libPath () const { return theLibPath; } | 117 | const std::string &libPath () const { return theLibPath; } |
618 | 167 | const std::string &modulePath () const { return theModulePath; } | 118 | const std::string &modulePath () const { return theModulePath; } |
619 | 168 | const std::string &classpath () const { return theClasspath; } | 119 | const std::string &classpath () const { return theClasspath; } |
620 | 169 | const std::vector<std::string> &option () const { return theOption; } | 120 | const std::vector<std::string> &option () const { return theOption; } |
622 | 170 | const bool &trailingNl () const { return theTrailingNl; } | 121 | bool trailingNl () const { return theTrailingNl; } |
623 | 171 | const std::vector<std::string> &stopWords () const { return theStopWords; } | 122 | const std::vector<std::string> &stopWords () const { return theStopWords; } |
624 | 172 | const std::vector<std::string> &thesaurus () const { return theThesaurus; } | 123 | const std::vector<std::string> &thesaurus () const { return theThesaurus; } |
989 | 173 | const bool& serializePlan () const { return theSerializePlan; } | 124 | bool serializePlan () const { return theSerializePlan; } |
990 | 174 | const bool& loadPlan () const { return theLoadPlan; } | 125 | bool loadPlan () const { return theLoadPlan; } |
991 | 175 | const bool& savePlan () const { return theSavePlan; } | 126 | bool savePlan () const { return theSavePlan; } |
992 | 176 | const bool& qBeforeF () const { return theQBeforeF; } | 127 | bool qBeforeF () const { return theQBeforeF; } |
993 | 177 | const bool& unknownOption() const { return theUnknownOption; } | 128 | bool unknownOption() const { return theUnknownOption; } |
994 | 178 | 129 | ||
995 | 179 | std::string load_argv (int argc, const char **argv) | 130 | std::string load_argv(int argc, const char **argv); |
996 | 180 | { | 131 | |
997 | 181 | if (argv == NULL) return ""; | 132 | const char* get_help_msg() const; |
998 | 182 | 133 | ||
999 | 183 | std::string result; | 134 | static const ZorbaCMDPropertiesBase* instance(); |
636 | 184 | for (++argv; *argv != NULL; ++argv) | ||
637 | 185 | { | ||
638 | 186 | if (strcmp (*argv, "--help") == 0 || strcmp (*argv, "-h") == 0) | ||
639 | 187 | return "!HELP"; | ||
640 | 188 | |||
641 | 189 | else if (strcmp (*argv, "--version") == 0) | ||
642 | 190 | return "!VER"; | ||
643 | 191 | |||
644 | 192 | else if (strcmp (*argv, "--timing") == 0 || strncmp (*argv, "-t", 2) == 0) | ||
645 | 193 | { | ||
646 | 194 | theTiming = true; | ||
647 | 195 | } | ||
648 | 196 | #ifdef ZORBA_WITH_FILE_ACCESS | ||
649 | 197 | else if (strcmp (*argv, "--output-file") == 0 || strncmp (*argv, "-o", 2) == 0) | ||
650 | 198 | { | ||
651 | 199 | int d = 2; | ||
652 | 200 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
653 | 201 | if (*argv == NULL) { result = "No value given for --output-file option"; break; } | ||
654 | 202 | init_val (*argv, theOutputFile, d); | ||
655 | 203 | } | ||
656 | 204 | #endif /* ZORBA_WITH_FILE_ACCESS */ | ||
657 | 205 | else if (strcmp (*argv, "--serialization-parameter") == 0 || strncmp (*argv, "-z", 2) == 0) | ||
658 | 206 | { | ||
659 | 207 | int d = 2; | ||
660 | 208 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
661 | 209 | if (*argv == NULL) { result = "No value given for --serialization-parameter option"; break; } | ||
662 | 210 | |||
663 | 211 | init_val (*argv, theSerializationParameter, d); | ||
664 | 212 | } | ||
665 | 213 | else if (strcmp (*argv, "--serialize-html") == 0) | ||
666 | 214 | { | ||
667 | 215 | theSerializeHtml = true; | ||
668 | 216 | } | ||
669 | 217 | else if (strcmp (*argv, "--serialize-text") == 0) | ||
670 | 218 | { | ||
671 | 219 | theSerializeText = true; | ||
672 | 220 | } | ||
673 | 221 | else if (strcmp (*argv, "--indent") == 0 || strncmp (*argv, "-i", 2) == 0) | ||
674 | 222 | { | ||
675 | 223 | theIndent = true; | ||
676 | 224 | } | ||
677 | 225 | else if (strcmp (*argv, "--print-query") == 0) | ||
678 | 226 | { | ||
679 | 227 | thePrintQuery = true; | ||
680 | 228 | } | ||
681 | 229 | else if (strcmp (*argv, "--print-errors-as-xml") == 0 || strncmp (*argv, "-x", 2) == 0) | ||
682 | 230 | { | ||
683 | 231 | thePrintErrorsAsXml = true; | ||
684 | 232 | } | ||
685 | 233 | else if (strcmp (*argv, "--byte-order-mark") == 0) | ||
686 | 234 | { | ||
687 | 235 | theByteOrderMark = true; | ||
688 | 236 | } | ||
689 | 237 | else if (strcmp (*argv, "--omit-xml-declaration") == 0 || strncmp (*argv, "-r", 2) == 0) | ||
690 | 238 | { | ||
691 | 239 | theOmitXmlDeclaration = true; | ||
692 | 240 | } | ||
693 | 241 | else if (strcmp (*argv, "--base-uri") == 0) | ||
694 | 242 | { | ||
695 | 243 | int d = 2; | ||
696 | 244 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
697 | 245 | if (*argv == NULL) { result = "No value given for --base-uri option"; break; } | ||
698 | 246 | init_val (*argv, theBaseUri, d); | ||
699 | 247 | } | ||
700 | 248 | else if (strcmp (*argv, "--boundary-space") == 0) | ||
701 | 249 | { | ||
702 | 250 | int d = 2; | ||
703 | 251 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
704 | 252 | if (*argv == NULL) { result = "No value given for --boundary-space option"; break; } | ||
705 | 253 | init_val (*argv, theBoundarySpace, d); | ||
706 | 254 | } | ||
707 | 255 | else if (strcmp (*argv, "--default-collation") == 0) | ||
708 | 256 | { | ||
709 | 257 | int d = 2; | ||
710 | 258 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
711 | 259 | if (*argv == NULL) { result = "No value given for --default-collation option"; break; } | ||
712 | 260 | init_val (*argv, theDefaultCollation, d); | ||
713 | 261 | } | ||
714 | 262 | else if (strcmp (*argv, "--construction-mode") == 0) | ||
715 | 263 | { | ||
716 | 264 | int d = 2; | ||
717 | 265 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
718 | 266 | if (*argv == NULL) { result = "No value given for --construction-mode option"; break; } | ||
719 | 267 | |||
720 | 268 | init_val (*argv, theConstructionMode, d); | ||
721 | 269 | } | ||
722 | 270 | else if (strcmp (*argv, "--ordering-mode") == 0) { | ||
723 | 271 | int d = 2; | ||
724 | 272 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
725 | 273 | if (*argv == NULL) { result = "No value given for --ordering-mode option"; break; } | ||
726 | 274 | |||
727 | 275 | init_val (*argv, theOrderingMode, d); | ||
728 | 276 | } | ||
729 | 277 | else if (strcmp (*argv, "--multiple") == 0 || strncmp (*argv, "-m", 2) == 0) | ||
730 | 278 | { | ||
731 | 279 | int d = 2; | ||
732 | 280 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
733 | 281 | if (*argv == NULL) | ||
734 | 282 | { | ||
735 | 283 | result = "No value given for --multiple option"; break; | ||
736 | 284 | } | ||
737 | 285 | init_val(*argv, theMultiple, d); | ||
738 | 286 | } | ||
739 | 287 | else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) | ||
740 | 288 | { | ||
741 | 289 | int d = 2; | ||
742 | 290 | if(theFparm == false) | ||
743 | 291 | theAsFiles = false; | ||
744 | 292 | if(*(argv+1) && !strncmp(*(argv+1), "-f", 2)) | ||
745 | 293 | { | ||
746 | 294 | theQBeforeF = true; // is it "-q -f <filename>" perhaps? | ||
747 | 295 | break; // stop functionality here | ||
748 | 296 | } | ||
749 | 297 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
750 | 298 | if (*argv == NULL) | ||
751 | 299 | { | ||
752 | 300 | result = "No value given for --query option"; break; | ||
753 | 301 | } | ||
754 | 302 | init_val (*argv, theQueriesOrFiles, d); | ||
755 | 303 | } | ||
756 | 304 | else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0) | ||
757 | 305 | { | ||
758 | 306 | theFparm = true; | ||
759 | 307 | theAsFiles = true; | ||
760 | 308 | } | ||
761 | 309 | else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0) | ||
762 | 310 | { | ||
763 | 311 | int d = 2; | ||
764 | 312 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
765 | 313 | if (*argv == NULL) | ||
766 | 314 | { | ||
767 | 315 | result = "No value given for --external-variable option"; break; | ||
768 | 316 | } | ||
769 | 317 | init_val(*argv, theExternalVariable, d); | ||
770 | 318 | } | ||
771 | 319 | else if (strcmp (*argv, "--context-item") == 0) | ||
772 | 320 | { | ||
773 | 321 | int d = 2; | ||
774 | 322 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
775 | 323 | if (*argv == NULL) | ||
776 | 324 | { | ||
777 | 325 | result = "No value given for --context-item option"; break; | ||
778 | 326 | } | ||
779 | 327 | init_val (*argv, theContextItem, d); | ||
780 | 328 | } | ||
781 | 329 | else if (strcmp (*argv, "--optimization-level") == 0) | ||
782 | 330 | { | ||
783 | 331 | int d = 2; | ||
784 | 332 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
785 | 333 | if (*argv == NULL) | ||
786 | 334 | { | ||
787 | 335 | result = "No value given for --optimization-level option"; break; | ||
788 | 336 | } | ||
789 | 337 | init_val(*argv, theOptimizationLevel, d); | ||
790 | 338 | } | ||
791 | 339 | else if (strcmp (*argv, "--lib-module") == 0 || strncmp (*argv, "-l", 2) == 0) | ||
792 | 340 | { | ||
793 | 341 | theLibModule = true; | ||
794 | 342 | } | ||
795 | 343 | else if (strcmp (*argv, "--parse-only") == 0) | ||
796 | 344 | { | ||
797 | 345 | theParseOnly = true; | ||
798 | 346 | } | ||
799 | 347 | else if (strcmp (*argv, "--compile-only") == 0) | ||
800 | 348 | { | ||
801 | 349 | theCompileOnly = true; | ||
802 | 350 | } | ||
803 | 351 | else if (strcmp (*argv, "--no-serializer") == 0) | ||
804 | 352 | { | ||
805 | 353 | theNoSerializer = true; | ||
806 | 354 | } | ||
807 | 355 | else if (strcmp (*argv, "--debug") == 0 || strncmp (*argv, "-d", 2) == 0) | ||
808 | 356 | { | ||
809 | 357 | theDebug = true; | ||
810 | 358 | } | ||
811 | 359 | else if (strcmp (*argv, "--debug-host") == 0 || strncmp (*argv, "-h", 2) == 0) | ||
812 | 360 | { | ||
813 | 361 | int d = 2; | ||
814 | 362 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
815 | 363 | if (*argv == NULL) | ||
816 | 364 | { | ||
817 | 365 | result = "No value given for --debug-host option"; break; | ||
818 | 366 | } | ||
819 | 367 | init_val (*argv, theDebugHost, d); | ||
820 | 368 | } | ||
821 | 369 | else if (strcmp (*argv, "--debug-port") == 0 || strncmp (*argv, "-p", 2) == 0) | ||
822 | 370 | { | ||
823 | 371 | int d = 2; | ||
824 | 372 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
825 | 373 | if (*argv == NULL) | ||
826 | 374 | { | ||
827 | 375 | result = "No value given for --debug-port option"; break; | ||
828 | 376 | } | ||
829 | 377 | init_val (*argv, theDebugPort, d); | ||
830 | 378 | } | ||
831 | 379 | else if (strcmp (*argv, "--no-logo") == 0) | ||
832 | 380 | { | ||
833 | 381 | theNoLogo = true; | ||
834 | 382 | } | ||
835 | 383 | else if (strcmp (*argv, "--timeout") == 0) | ||
836 | 384 | { | ||
837 | 385 | int d = 2; | ||
838 | 386 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
839 | 387 | if (*argv == NULL) { result = "No value given for --timeout option"; break; } | ||
840 | 388 | init_val (*argv, theTimeout, d); | ||
841 | 389 | } | ||
842 | 390 | else if (strcmp (*argv, "--uri-path") == 0) | ||
843 | 391 | { | ||
844 | 392 | int d = 2; | ||
845 | 393 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
846 | 394 | if (*argv == NULL) { result = "No value given for --uri-path option"; break; } | ||
847 | 395 | init_val (*argv, theUriPath, d); | ||
848 | 396 | } | ||
849 | 397 | else if (strcmp (*argv, "--lib-path") == 0) | ||
850 | 398 | { | ||
851 | 399 | int d = 2; | ||
852 | 400 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
853 | 401 | if (*argv == NULL) { result = "No value given for --lib-path option"; break; } | ||
854 | 402 | init_val (*argv, theLibPath, d); | ||
855 | 403 | } | ||
856 | 404 | else if (strcmp (*argv, "--module-path") == 0) | ||
857 | 405 | { | ||
858 | 406 | int d = 2; | ||
859 | 407 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
860 | 408 | if (*argv == NULL) { result = "No value given for --module-path option"; break; } | ||
861 | 409 | init_val (*argv, theModulePath, d); | ||
862 | 410 | } | ||
863 | 411 | else if (strcmp (*argv, "--classpath") == 0) | ||
864 | 412 | { | ||
865 | 413 | int d = 2; | ||
866 | 414 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
867 | 415 | if (*argv == NULL) { result = "No value given for --classpath option"; break; } | ||
868 | 416 | |||
869 | 417 | init_val (*argv, theClasspath, d); | ||
870 | 418 | } | ||
871 | 419 | else if (strcmp (*argv, "--option") == 0) | ||
872 | 420 | { | ||
873 | 421 | int d = 2; | ||
874 | 422 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
875 | 423 | if (*argv == NULL) { result = "No value given for --option option"; break; } | ||
876 | 424 | init_val (*argv, theOption, d); | ||
877 | 425 | } | ||
878 | 426 | else if (strcmp (*argv, "--trailing-nl") == 0) | ||
879 | 427 | { | ||
880 | 428 | theTrailingNl = true; | ||
881 | 429 | } | ||
882 | 430 | else if (strcmp (*argv, "--stop-words") == 0) | ||
883 | 431 | { | ||
884 | 432 | int d = 2; | ||
885 | 433 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
886 | 434 | if (*argv == NULL) { result = "No value given for --stop-words option"; break; } | ||
887 | 435 | init_val (*argv, theStopWords, d); | ||
888 | 436 | } | ||
889 | 437 | else if (strcmp (*argv, "--thesaurus") == 0) | ||
890 | 438 | { | ||
891 | 439 | int d = 2; | ||
892 | 440 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | ||
893 | 441 | if (*argv == NULL) { result = "No value given for --thesaurus option"; break; } | ||
894 | 442 | init_val (*argv, theThesaurus, d); | ||
895 | 443 | } | ||
896 | 444 | else if (strcmp (*argv, "--serialize-plan") == 0 || strncmp (*argv, "-s", 2) == 0) | ||
897 | 445 | { | ||
898 | 446 | theSerializePlan = true; | ||
899 | 447 | } | ||
900 | 448 | else if (strcmp (*argv, "--compile-plan") == 0) | ||
901 | 449 | { | ||
902 | 450 | theSavePlan = true; | ||
903 | 451 | } | ||
904 | 452 | else if (strcmp (*argv, "--execute-plan") == 0) | ||
905 | 453 | { | ||
906 | 454 | theLoadPlan = true; | ||
907 | 455 | } | ||
908 | 456 | else if (strcmp (*argv, "--disable-http-resolution") == 0) | ||
909 | 457 | { | ||
910 | 458 | init_val ("{http://zorba.io/options/features}disable=http-uri-resolution", | ||
911 | 459 | theOption, 0); | ||
912 | 460 | } | ||
913 | 461 | else if (strcmp (*argv, "--") == 0) | ||
914 | 462 | { | ||
915 | 463 | copy_args (++argv); | ||
916 | 464 | break; | ||
917 | 465 | } | ||
918 | 466 | else if ((*argv) [0] == '-') | ||
919 | 467 | { | ||
920 | 468 | result = "unknown command line option "; result += *argv; | ||
921 | 469 | theUnknownOption = true; break; | ||
922 | 470 | } | ||
923 | 471 | else | ||
924 | 472 | { | ||
925 | 473 | init_val(*argv, theQueriesOrFiles, 0); | ||
926 | 474 | copy_args (argv); | ||
927 | 475 | } | ||
928 | 476 | } | ||
929 | 477 | |||
930 | 478 | return result; | ||
931 | 479 | } | ||
932 | 480 | |||
933 | 481 | const char *get_help_msg () const | ||
934 | 482 | { | ||
935 | 483 | return | ||
936 | 484 | "--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n" | ||
937 | 485 | "--output-file, -o\nWrite the result to the given file.\n\n" | ||
938 | 486 | "--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n" | ||
939 | 487 | "--serialize-html\nSerialize the result as HTML.\n\n" | ||
940 | 488 | "--serialize-text\nSerialize the result as Text.\n\n" | ||
941 | 489 | "--indent, -i\nIndent output.\n\n" | ||
942 | 490 | "--print-query\nPrint the queries.\n\n" | ||
943 | 491 | "--print-errors-as-xml, -x\nPrint the errors as XML.\n\n" | ||
944 | 492 | "--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n" | ||
945 | 493 | "--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n" | ||
946 | 494 | "--base-uri\nSet the base URI property of the static context.\n\n" | ||
947 | 495 | "--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n" | ||
948 | 496 | "--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n" | ||
949 | 497 | "--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n" | ||
950 | 498 | "--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n" | ||
951 | 499 | "--multiple, -m\nExecute the given queries multiple times.\n\n" | ||
952 | 500 | "--query, -q\nQuery test or file URI (file://...)\n\n" | ||
953 | 501 | "--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries. This option is deprecated and will be defaulted to true in the future, so any entry in the command line is going to be treated as files.\n\n" | ||
954 | 502 | "--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n" | ||
955 | 503 | "--context-item\nSet the context item to the XML document in a given file.\n\n" | ||
956 | 504 | "--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n" | ||
957 | 505 | "--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n" | ||
958 | 506 | "--parse-only\nStop after parsing the query.\n\n" | ||
959 | 507 | "--compile-only\nOnly compile (don't execute)\n\n" | ||
960 | 508 | "--no-serializer\nDo not serialize (discard) result.\n\n" | ||
961 | 509 | "--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n" | ||
962 | 510 | "--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n" | ||
963 | 511 | "--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n" | ||
964 | 512 | "--no-logo\nPrint no logo when starting.\n\n" | ||
965 | 513 | "--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n" | ||
966 | 514 | "--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n" | ||
967 | 515 | "--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n" | ||
968 | 516 | "--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n" | ||
969 | 517 | "--classpath\nJVM classpath to be used by modules using Java implementations\n\n" | ||
970 | 518 | "--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://zorba.io/}option=value\n\n" | ||
971 | 519 | "--trailing-nl\nOutput a trailing newline after the result of the query.\n\n" | ||
972 | 520 | "--stop-words\nMapping specifying a stop-words URI to another.\n\n" | ||
973 | 521 | "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n" | ||
974 | 522 | "--serialize-plan, -s\nSerialize and then load the query execution plan.\n\n" | ||
975 | 523 | "--compile-plan,\nDo not execute the query; just compile it and save the execution plan in the file specified with the -o option.\n\n" | ||
976 | 524 | "--execute-plan\nDo not compile the query; instead load the execution plan from the file specified by the -f -q options (or by any file specified without any other argument), and execute the loaded plan.\n\n" | ||
977 | 525 | "--disable-http-resolution\nDo not use HTTP to resolve URIs\n\n" | ||
978 | 526 | ; | ||
979 | 527 | } | ||
980 | 528 | |||
981 | 529 | static const ZorbaCMDPropertiesBase *instance () | ||
982 | 530 | { | ||
983 | 531 | static ZorbaCMDPropertiesBase result; | ||
984 | 532 | return &result; | ||
985 | 533 | } | ||
986 | 534 | |||
987 | 535 | ZorbaCMDPropertiesBase () { initialize (); } | ||
988 | 536 | |||
1000 | 537 | }; | 135 | }; |
1001 | 538 | 136 | ||
1005 | 539 | } // namespaces | 137 | /////////////////////////////////////////////////////////////////////////////// |
1006 | 540 | 138 | ||
1007 | 541 | #endif // ZORBACMD_ZORBACMDPROPERTIESBASE | 139 | } // namespace zorbacmd |
1008 | 140 | |||
1009 | 141 | #endif /* ZORBACMD_ZORBACMDPROPERTIESBASE */ | ||
1010 | 142 | /* vim:set et sw=2 ts=2: */ |
Validation queue starting for the following merge proposals: /code.launchpad .net/~paul- lucas/zorba/ pjl-misc/ +merge/ 204361
https:/
Progress dashboard at http:// jenkins. zorba.io: 8180/view/ ValidationQueue