diff --git a/basex-core/src/main/java/org/basex/BaseX.java b/basex-core/src/main/java/org/basex/BaseX.java index 8b15ce2096..f1274810e8 100644 --- a/basex-core/src/main/java/org/basex/BaseX.java +++ b/basex-core/src/main/java/org/basex/BaseX.java @@ -101,6 +101,10 @@ public BaseX(final String... args) throws IOException { out = new PrintOutput(new IOFile(value)); session().setOutputStream(out); break; + case 'O': + String[] kv = value.split("=", 2); + execute(new Set(kv[0], kv.length > 1 ? kv[1] : ""), false); + break; case 'q': console = false; execute(new XQuery(value), verbose); @@ -118,7 +122,7 @@ public BaseX(final String... args) throws IOException { break; case 's': if(sopts == null) sopts = new SerializerOptions(); - final String[] kv = value.split("=", 2); + kv = value.split("=", 2); sopts.assign(kv[0], kv.length > 1 ? kv[1] : ""); execute(new Set(MainOptions.SERIALIZER, sopts), false); break; @@ -215,8 +219,8 @@ protected final void parseArgs() throws IOException { if(c == 'd') { // activate debug mode Prop.debug = true; - } else if(c == 'b' || c == 'c' || c == 'C' || c == 'i' || c == 'I' || c == 'o' || - c == 'q' || c == 'Q' || c == 'r' || c == 's' || c == 't' && local()) { + } else if(c == 't' && local() || c == 'b' || c == 'c' || c == 'C' || c == 'i' || c == 'I' || + c == 'o' || c == 'O' || c == 'q' || c == 'Q' || c == 'r' || c == 's') { // options followed by a string v = arg.string(); } else if(c == 'D' && local() || c == 'u' && local() || c == 'R' || diff --git a/basex-core/src/main/java/org/basex/core/Text.java b/basex-core/src/main/java/org/basex/core/Text.java index d4102ebec4..9d5b0ed1b4 100644 --- a/basex-core/src/main/java/org/basex/core/Text.java +++ b/basex-core/src/main/java/org/basex/core/Text.java @@ -86,63 +86,65 @@ public interface Text { String S_STANDALONE = "Standalone"; /** Start information. */ String S_LOCALINFO = - " [-bcCdiIoqQrRstuvVwWxz] [input]" + NL + - " [input] XQuery or command file, or query string" + NL + - " -b Bind external query variables" + NL + - " -c Execute commands from file or string" + NL + - " -C Execute command script file" + NL + - " -d Toggle debugging output" + NL + - " -i Bind file or database to context" + NL + - " -I Bind input string to context" + NL + - " -o Write output to local file" + NL + - " -q Execute XQuery expression" + NL + - " -Q Execute XQuery file" + NL + - " -r Run query multiple times" + NL + - " -R Toggle query execution" + NL + - " -s Set serialization parameters" + NL + - " -t[path] Run tests in file or directory" + NL + - " -u Toggle updates in original files" + NL + - " -v Toggle output of progress info" + NL + - " -V Toggle detailed query output" + NL + - " -w Toggle whitespace stripping" + NL + - " -W Enable indentation with whitespace" + NL + - " -x Toggle output of query plan" + NL + - " -z Toggle output of query result"; + " [options...] [input]" + NL + + " [input] XQuery or command file, or query string" + NL + + " -b Bind query variable (name=value)" + NL + + " -c Execute commands from file or string" + NL + + " -C Execute command script file" + NL + + " -d Toggle debugging output" + NL + + " -i Bind file or database to context" + NL + + " -I Bind input string to context" + NL + + " -o Write output to local file" + NL + + " -O