Difference between revisions of "Command-Line Options"
(21 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
=Standalone= | =Standalone= | ||
− | + | The following options are available for the standalone [[Command-Line Client]]: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
$ basex -h | $ basex -h | ||
Line 33: | Line 27: | ||
-v Toggle output of progress info | -v Toggle output of progress info | ||
-V Toggle detailed query output | -V Toggle detailed query output | ||
− | -w Toggle whitespace | + | -w Toggle whitespace stripping |
-x Toggle output of query plan | -x Toggle output of query plan | ||
-z Toggle output of query result | -z Toggle output of query result | ||
</pre> | </pre> | ||
− | + | Further details are listed in the following table. If an equivalent database option exists (which can be specified via the {{Command|SET}} command), it is listed as well. | |
− | For the examples to work, it might be necessary to escape some characters depending on your | + | For the examples to work, it might be necessary to escape some characters depending on your operating system. |
{| class="wikitable" | {| class="wikitable" | ||
Line 64: | Line 58: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-c<input>}} | | {{Code|-c<input>}} | ||
− | | Executes [[commands]] | + | | Executes [[commands]]. If the specified input is a valid URI or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]]. |
− | |||
− | |||
| | | | ||
| | | | ||
− | |• {{Code|-c | + | |• {{Code|-c list}}<br/>• {{Code|-ccommands.txt}}<br/>• {{Code|-c"<info/>"}} |
|- valign="top" | |- valign="top" | ||
| {{Code|-d}} | | {{Code|-d}} | ||
Line 108: | Line 100: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-R}} | | {{Code|-R}} | ||
− | | Specifies if a query will be | + | | Specifies if a query will be evaluated or parsed and compiled only. |
| {{Option|RUNQUERY}} | | {{Option|RUNQUERY}} | ||
| <code>true</code> | | <code>true</code> | ||
Line 144: | Line 136: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-w}} | | {{Code|-w}} | ||
− | | Toggles whitespace | + | | Toggles whitespace stripping of XML text nodes. By default, whitespaces will be preserved. |
− | | {{Option| | + | | {{Option|STRIPWS}} |
− | | <code> | + | | <code>false</code> |
| | | | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-x}} | | {{Code|-x}} | ||
− | | Toggles the output of the query execution plan, formatted as | + | | Toggles the output of the query execution plan, formatted as XML. |
| {{Option|XMLPLAN}} | | {{Option|XMLPLAN}} | ||
| <code>false</code> | | <code>false</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| | | | ||
|- valign="top" | |- valign="top" | ||
Line 169: | Line 155: | ||
=GUI= | =GUI= | ||
− | |||
− | The | + | The following options are available for the standalone [[GUI|Graphical User Interface]]: |
<pre> | <pre> | ||
− | $ basexgui [ | + | $ basexgui -h |
+ | BaseX [GUI] | ||
+ | Usage: basexgui [-d] [files] | ||
+ | [files] Open specified files | ||
+ | -d Enable debugging | ||
</pre> | </pre> | ||
+ | |||
+ | You can pass one or more files as parameters. If an XML document is specified, a database instance can be created from this file. Other files are opened in the editor. | ||
=Server= | =Server= | ||
− | + | The following options are available for the [[Database Server]]: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
$ basexserver -h | $ basexserver -h | ||
Line 200: | Line 185: | ||
</pre> | </pre> | ||
− | + | Details on all options are listed in the following table (equivalent database options are shown in the table as well). | |
− | For the examples to work, it might be necessary to escape some characters depending on your | + | For the examples to work, it might be necessary to escape some characters depending on your operating system. |
{| class="wikitable" | {| class="wikitable" | ||
Line 217: | Line 202: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-c<input>}} | | {{Code|-c<input>}} | ||
− | | Executes [[commands]] | + | | Executes [[commands]]. If the specified input is a valid URI or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]]. |
− | |||
− | |||
| | | | ||
| | | | ||
Line 225: | Line 208: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-d}} | | {{Code|-d}} | ||
− | | | + | | Enables debugging output. Debugging information is output to ''standard error''. |
| {{Option|DEBUG}} | | {{Option|DEBUG}} | ||
| <code>false</code> | | <code>false</code> | ||
Line 258: | Line 241: | ||
=Client= | =Client= | ||
− | + | If the [[Database Server|Database Client]] is launched, you will be requested for a username and password. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
$ basexclient -h | $ basexclient -h | ||
Line 289: | Line 261: | ||
-R Toggle query execution | -R Toggle query execution | ||
-s<args> Set serialization parameters | -s<args> Set serialization parameters | ||
− | -U<name> Specify | + | -U<name> Specify username |
-v Toggle output of progress info | -v Toggle output of progress info | ||
-V Toggle detailed query output | -V Toggle detailed query output | ||
− | -w Toggle whitespace | + | -w Toggle whitespace stripping |
-x Toggle output of query plan | -x Toggle output of query plan | ||
-z Toggle output of query result | -z Toggle output of query result | ||
</pre> | </pre> | ||
− | + | See the following table for details (equivalent database options are shown in the table as well). | |
− | For the examples to work, it might be necessary to escape some characters depending on your | + | For the examples to work, it might be necessary to escape some characters, depending on your operating system. |
{| class="wikitable" | {| class="wikitable" | ||
Line 317: | Line 289: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-b<args>}} | | {{Code|-b<args>}} | ||
− | | Binds external variables to XQuery expressions. This flag may be specified multiple times. Variables names and their values are delimited by equality signs (<code>=</code>). The names may be optionally prefixed with dollar signs. If a variable uses a namespace different to the default namespace, it can be specified with the [http://www.jclark.com/xml/xmlns.htm Clark Notation] or [ | + | | Binds external variables to XQuery expressions. This flag may be specified multiple times. Variables names and their values are delimited by equality signs (<code>=</code>). The names may be optionally prefixed with dollar signs. If a variable uses a namespace different to the default namespace, it can be specified with the [http://www.jclark.com/xml/xmlns.htm Clark Notation] or [https://www.w3.org/TR/xquery-30/#id-basics Expanded QName Notation]. |
| {{Option|BINDINGS}} | | {{Option|BINDINGS}} | ||
| | | | ||
Line 323: | Line 295: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-c<input>}} | | {{Code|-c<input>}} | ||
− | | Executes [[commands]] | + | | Executes [[commands]]. If the specified input is a valid URI or file reference, its content will be executed instead. Empty lines and lines starting with the number sign {{Code|#}} will be ignored. |
− | |||
− | |||
| | | | ||
| | | | ||
− | |• {{Code|-c | + | |• {{Code|-c list}}<br/>• {{Code|-ccommands.txt}}<br/>• {{Code|-c"<info/>"}} |
|- valign="top" | |- valign="top" | ||
| {{Code|-d}} | | {{Code|-d}} | ||
Line 367: | Line 337: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-P<pass>}} | | {{Code|-P<pass>}} | ||
− | | Specifies the user password. If this flag is omitted, the password will be requested on command line. ''Warning'': | + | | Specifies the user password. If this flag is omitted, the password will be requested on command line. ''Warning'': When the password is supplied with this flag, it may end up in logs or the bash history. |
| {{Option|PASSWORD}} | | {{Option|PASSWORD}} | ||
| | | | ||
− | | {{Code|-Uadmin - | + | | {{Code|-Uadmin -P...}} |
|- valign="top" | |- valign="top" | ||
| {{Code|-q<expr>}} | | {{Code|-q<expr>}} | ||
Line 396: | Line 366: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-U<name>}} | | {{Code|-U<name>}} | ||
− | | Specifies the | + | | Specifies the username. If this flag is omitted, the username will be requested on command line. |
| {{Option|USER}} | | {{Option|USER}} | ||
| | | | ||
Line 414: | Line 384: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-w}} | | {{Code|-w}} | ||
− | | Toggles whitespace | + | | Toggles whitespace stripping of XML text nodes. By default, whitespaces will be preserved. |
− | | {{Option| | + | | {{Option|STRIPWS}} |
− | | <code> | + | | <code>false</code> |
| | | | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-x}} | | {{Code|-x}} | ||
− | | Toggles the output of the query execution plan, formatted as | + | | Toggles the output of the query execution plan, formatted as XML. |
| {{Option|XMLPLAN}} | | {{Option|XMLPLAN}} | ||
| <code>false</code> | | <code>false</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| | | | ||
|- valign="top" | |- valign="top" | ||
Line 440: | Line 404: | ||
=HTTP Server= | =HTTP Server= | ||
− | + | {{Announce|With Version 10, the default ports have been changed from 8984/8985 to 8080/8081.}} | |
− | + | ||
− | + | The following options are available for the [[Web Application|HTTP Server]]: | |
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
$ basexhttp -h | $ basexhttp -h | ||
Line 456: | Line 415: | ||
-c<input> Execute commands from file or string | -c<input> Execute commands from file or string | ||
-d Enable debugging output | -d Enable debugging output | ||
+ | -g Enable GZIP support | ||
-h<port> Set port of HTTP server | -h<port> Set port of HTTP server | ||
-l Start in local mode | -l Start in local mode | ||
Line 462: | Line 422: | ||
-s<port> Specify port to stop HTTP server | -s<port> Specify port to stop HTTP server | ||
-S Start as service | -S Start as service | ||
− | -U<name> Specify | + | -U<name> Specify username |
-z Suppress logging | -z Suppress logging | ||
</pre> | </pre> | ||
Line 484: | Line 444: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-c<input>}} | | {{Code|-c<input>}} | ||
− | | Executes [[commands]] | + | | Executes [[commands]]. If the specified input is a valid URI or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]]. |
− | |||
− | |||
| | | | ||
| | | | ||
| {{Code|-c"open database"}} | | {{Code|-c"open database"}} | ||
|- valign="top" | |- valign="top" | ||
− | | {{Code|- | + | | {{Code|-e}} |
− | | | + | | Enables debugging output. Debugging information is output to ''standard error''. |
| {{Option|DEBUG}} | | {{Option|DEBUG}} | ||
+ | | | ||
+ | | | ||
+ | |- valign="top" | ||
+ | | {{Code|-g}} | ||
+ | | Enables GZIP support in Jetty. | ||
+ | | {{Option|GZIP}} | ||
| | | | ||
| | | | ||
Line 500: | Line 464: | ||
| Specifies the port on which the HTTP server will be addressable. | | Specifies the port on which the HTTP server will be addressable. | ||
| <code>jetty.xml</code> | | <code>jetty.xml</code> | ||
− | | {{Code| | + | | {{Code|8080}} |
| {{Code|-h9999}} | | {{Code|-h9999}} | ||
|- valign="top" | |- valign="top" | ||
Line 524: | Line 488: | ||
| Specifies the port that will be used to stop the HTTP server. | | Specifies the port that will be used to stop the HTTP server. | ||
| {{Option|STOPPORT}} or<br/><code>pom.xml</code> | | {{Option|STOPPORT}} or<br/><code>pom.xml</code> | ||
− | | <code> | + | | <code>8081</code> |
| | | | ||
|- valign="top" | |- valign="top" | ||
Line 533: | Line 497: | ||
|- valign="top" | |- valign="top" | ||
| {{Code|-U<name>}} | | {{Code|-U<name>}} | ||
− | | Specifies a | + | | Specifies a username, which will be used by the HTTP services for opening a new session. |
| {{Option|USER}} | | {{Option|USER}} | ||
| | | | ||
Line 545: | Line 509: | ||
=Changelog= | =Changelog= | ||
+ | |||
+ | ;Version 10.0 | ||
+ | * Updated: Whitespaces are now preserved by default (see {{Option|STRIPWS}} for more details). | ||
;Version 9.0 | ;Version 9.0 | ||
− | |||
* Added: BaseXHTTP, command-line option {{Code|-c}}. | * Added: BaseXHTTP, command-line option {{Code|-c}}. | ||
* Updated: BaseXHTTP, command-line option {{Code|-c}}, additionally accepts valid URLs and file references. | * Updated: BaseXHTTP, command-line option {{Code|-c}}, additionally accepts valid URLs and file references. | ||
;Version 8.2 | ;Version 8.2 | ||
− | |||
* Removed: Event ports, {{Code|-e}}. | * Removed: Event ports, {{Code|-e}}. | ||
;Version 8.1 | ;Version 8.1 | ||
− | |||
* Added: Bind input strings to the query context with {{Code|-I}}. | * Added: Bind input strings to the query context with {{Code|-I}}. | ||
;Version 8.0 | ;Version 8.0 | ||
− | |||
* Removed: Command-line option <code>-L</code> (results will now be automatically separated by newlines). | * Removed: Command-line option <code>-L</code> (results will now be automatically separated by newlines). | ||
;Version 7.9 | ;Version 7.9 | ||
− | |||
* Added: Runs tests in file or directory with {{Code|-t}}. | * Added: Runs tests in file or directory with {{Code|-t}}. | ||
* Removed: interactive server mode. | * Removed: interactive server mode. | ||
;Version 7.8 | ;Version 7.8 | ||
− | |||
* Added: Specify if a query will be executed or parsed only with {{Code|-R}}. | * Added: Specify if a query will be executed or parsed only with {{Code|-R}}. | ||
;Version 7.7 | ;Version 7.7 | ||
− | |||
* Added: Bind host to the [[#BaseX Server|BaseX Server]] with {{Code|-n}}. | * Added: Bind host to the [[#BaseX Server|BaseX Server]] with {{Code|-n}}. | ||
;Version 7.5 | ;Version 7.5 | ||
− | |||
* Added: detection of [[Commands#Basics|Command Scripts]]. | * Added: detection of [[Commands#Basics|Command Scripts]]. | ||
* Removed: HTTP server flags {{Code|-R}}, {{Code|-W}}, and {{Code|-X}}. | * Removed: HTTP server flags {{Code|-R}}, {{Code|-W}}, and {{Code|-X}}. | ||
; Version 7.3: | ; Version 7.3: | ||
− | |||
* Updated: all options are now evaluated in the given order. | * Updated: all options are now evaluated in the given order. | ||
* Updated: Create main-memory representations for specified sources with {{Code|-i}}. | * Updated: Create main-memory representations for specified sources with {{Code|-i}}. | ||
Line 589: | Line 547: | ||
; Version 7.2: | ; Version 7.2: | ||
− | |||
* Added: RESTXQ Service | * Added: RESTXQ Service | ||
; Version 7.1.1: | ; Version 7.1.1: | ||
− | |||
* Added: Options {{Code|-C}} and {{Code|-L}} in standalone and client mode. | * Added: Options {{Code|-C}} and {{Code|-L}} in standalone and client mode. | ||
; Version 7.1: | ; Version 7.1: | ||
− | |||
* Updated: Multiple query files and {{Code|-c}}/{{Code|-i}}/{{Code|-q}} flags can be specified. | * Updated: Multiple query files and {{Code|-c}}/{{Code|-i}}/{{Code|-q}} flags can be specified. |
Revision as of 14:47, 25 July 2022
This article is part of the Getting Started Guide. Each BaseX Startup mode has one or more command-line options which are described in this article.
Command-line options can be specified multiple times. Please note that all options will be evaluated in the given order. The standard input can be parsed by specifying a single dash (-
) as argument.
Standalone
The following options are available for the standalone Command-Line Client:
$ basex -h BaseX [Standalone] Usage: basex [-bcdiIoqrRstuvVwxz] [input] [input] XQuery or command file, or query string -b<args> Bind external query variables -c<input> Execute commands from file or string -d Toggle debugging output -i<input> Bind file or database to context -I<input> Bind input string to context -o<path> Write output to local file -q<expr> Execute XQuery expression -r<num> Run query multiple times -R Toggle query execution -s<args> Set serialization parameters -t[path] Run tests in file or directory -u Toggle updates in original files -v Toggle output of progress info -V Toggle detailed query output -w Toggle whitespace stripping -x Toggle output of query plan -z Toggle output of query result
Further details are listed in the following table. If an equivalent database option exists (which can be specified via the SET
command), it is listed as well.
For the examples to work, it might be necessary to escape some characters depending on your operating system.
Flag | Description | Option | Default | Examples |
---|---|---|---|---|
[input]
|
Evaluates the specified input:
|
• "doc('X')//head" • query.xq • commands.bxs | ||
-b<args>
|
Binds external variables to XQuery expressions. This flag may be specified multiple times. Variables names and their values are delimited by equality signs (= ). The names may be optionally prefixed with dollar signs. If a variable uses a namespace different to the default namespace, it can be specified with the Clark Notation.
|
BINDINGS
|
• -bv=example "declare variable $v external; $v" • -b{URL}ln=value
| |
-c<input>
|
Executes commands. If the specified input is a valid URI or file reference, this file will be evaluated as Command Script. | • -c list • -ccommands.txt • -c"<info/>"
| ||
-d
|
Toggles the debugging mode. Debugging information is output to standard error. | DEBUG
|
false
|
|
-i<input>
|
Opens the specified XML file, directory with XML files, or database. The opened input can then be processed by a command or XQuery expression. | -iitems.xml "//item"
| ||
-I<input>
|
Assigns an input string as item of type xs:untypedAtomic to the query context.
|
-I "Hello Universe" -q "."
| ||
-o<path>
|
All command and query output is written to the specified file. | -o output.txt
| ||
-q<expr>
|
Executes the specified string as XQuery expression. | -q"doc('input')//head"
| ||
-r<num>
|
Specifies how often a specified query will be evaluated. | RUNS
|
1
|
-V -r10 "1"
|
-R
|
Specifies if a query will be evaluated or parsed and compiled only. | RUNQUERY
|
true
|
-V -R "1"
|
-s<args>
|
Specifies parameters for serializing XQuery results; see Serialization for more details. This flag may be specified multiple times. Key and values are separated by the equality sign (= ).
|
SERIALIZER
|
-smethod=text
| |
-t[path]
|
Runs all Unit tests in the specified file or directory. | -t project/tests | ||
-u
|
Propagates updates on input files back to disk. | WRITEBACK
|
false
|
|
-v
|
Toggles the output of process and timing information. | false
|
||
-V
|
Prints detailed query information to the standard output, including details on the compilation and profiling steps. | QUERYINFO
|
false
|
|
-w
|
Toggles whitespace stripping of XML text nodes. By default, whitespaces will be preserved. | STRIPWS
|
false
|
|
-x
|
Toggles the output of the query execution plan, formatted as XML. | XMLPLAN
|
false
|
|
-z
|
Turns the serialization of XQuery results on/off. This flag is useful if the query is profiled or analyzed. | SERIALIZE
|
true
|
GUI
The following options are available for the standalone Graphical User Interface:
$ basexgui -h BaseX [GUI] Usage: basexgui [-d] [files] [files] Open specified files -d Enable debugging
You can pass one or more files as parameters. If an XML document is specified, a database instance can be created from this file. Other files are opened in the editor.
Server
The following options are available for the Database Server:
$ basexserver -h BaseX [Server] Usage: basexserver [-cdnpSz] [stop] stop Stop running server -c<input> Execute commands from file or string -d Enable debugging output -n<name> Set host the server is bound to -p<port> Set server port -S Start as service -z Suppress logging
Details on all options are listed in the following table (equivalent database options are shown in the table as well). For the examples to work, it might be necessary to escape some characters depending on your operating system.
Flag | Description | Option | Default | Examples |
---|---|---|---|---|
stop
|
Stops a local database server instance and quits. | |||
-c<input>
|
Executes commands. If the specified input is a valid URI or file reference, this file will be evaluated as Command Script. | -c"open database;info"
| ||
-d
|
Enables debugging output. Debugging information is output to standard error. | DEBUG
|
false
|
|
-n<name>
|
Specifies the host the server will be bound to. | SERVERHOST
|
-p127.0.0.1
| |
-p<port>
|
Specifies the port on which the server will be addressable. | SERVERPORT
|
1984
|
-p9999
|
-S
|
Starts the server as service (i.e., in the background). Use YAJSW, or start BaseX as an ordinary background process to get more options. | |||
-z
|
Prevents the generation of log files. | LOG
|
true
|
Multiple -c
and -i
flags can be specified. All other options will be set before any other operation takes place. The specified inputs, query files, queries and commands will be subsequently evaluated after that in the given order. The standard input can be parsed by specifying a single dash (-
) as argument.
Client
If the Database Client is launched, you will be requested for a username and password.
$ basexclient -h BaseX [Client] Usage: basexclient [-bcdiInopPqrRsUvVwxz] [input] [input] XQuery or command file, or query string -b<args> Bind external query variables -c<input> Execute commands from file or string -d Toggle debugging output -i<input> Bind file or database to context -I<input> Bind input string to context -n<name> Set server (host) name -o<path> Write output to local file -p<port> Set server port -P<pass> Specify user password -q<expr> Execute XQuery expression -r<num> Run query multiple times -R Toggle query execution -s<args> Set serialization parameters -U<name> Specify username -v Toggle output of progress info -V Toggle detailed query output -w Toggle whitespace stripping -x Toggle output of query plan -z Toggle output of query result
See the following table for details (equivalent database options are shown in the table as well). For the examples to work, it might be necessary to escape some characters, depending on your operating system.
Flag | Description | Option | Default | Examples |
---|---|---|---|---|
[input]
|
Evaluates the specified input:
|
• "doc('X')//head" • query.xq • commands.bxs | ||
-b<args>
|
Binds external variables to XQuery expressions. This flag may be specified multiple times. Variables names and their values are delimited by equality signs (= ). The names may be optionally prefixed with dollar signs. If a variable uses a namespace different to the default namespace, it can be specified with the Clark Notation or Expanded QName Notation.
|
BINDINGS
|
• -b$v=example "declare variable $v external; $v" • -b{URL}ln=value
| |
-c<input>
|
Executes commands. If the specified input is a valid URI or file reference, its content will be executed instead. Empty lines and lines starting with the number sign # will be ignored.
|
• -c list • -ccommands.txt • -c"<info/>"
| ||
-d
|
Toggles the debugging mode. Debugging information is output to standard error. | DEBUG
|
false
|
|
-i<input>
|
Opens the specified XML file, directory with XML files, or database. The opened input can then be processed by a command or XQuery expression. | -iitems.xml "//item"
| ||
-I<input>
|
Assigns an input string as item of type xs:untypedAtomic to the query context.
|
-I "Hello Universe" -q "."
| ||
-n<name>
|
Specifies the host name on which the server is running. | HOST
|
localhost
|
-nserver.basex.org
|
-o<path>
|
All command and query output is written to the specified file. | |||
-p<port>
|
Specifies the port on which the server is running. | PORT
|
1984
|
-p9999
|
-P<pass>
|
Specifies the user password. If this flag is omitted, the password will be requested on command line. Warning: When the password is supplied with this flag, it may end up in logs or the bash history. | PASSWORD
|
-Uadmin -P...
| |
-q<expr>
|
Executes the specified string as XQuery expression. | -q"1+2"
| ||
-r<num>
|
Specifies how often a specified query will be evaluated. | RUNS
|
1
|
-V -r10 "1"
|
-R
|
Specifies if a query will be executed or parsed only. | RUNQUERY
|
true
|
-V -R "1"
|
-s<args>
|
Specifies parameters for serializing XQuery results; see Serialization for more details. This flag may be specified multiple times. Key and values are separated by the equality sign (= ).
|
SERIALIZER
|
-smethod=text
| |
-U<name>
|
Specifies the username. If this flag is omitted, the username will be requested on command line. | USER
|
-Uadmin
| |
-v
|
Prints process and timing information to the standard output. | false
|
||
-V
|
Prints detailed query information to the standard output, including details on the compilation and profiling steps. | QUERYINFO
|
false
|
|
-w
|
Toggles whitespace stripping of XML text nodes. By default, whitespaces will be preserved. | STRIPWS
|
false
|
|
-x
|
Toggles the output of the query execution plan, formatted as XML. | XMLPLAN
|
false
|
|
-z
|
Turns the serialization of XQuery results on/off. This flag is useful if the query is profiled or analyzed. | SERIALIZE
|
true
|
HTTP Server
With Version 10, the default ports have been changed from 8984/8985 to 8080/8081.
The following options are available for the HTTP Server:
$ basexhttp -h BaseX [HTTP] Usage: basexhttp [-cdhlnpsSUz] [stop] stop Stop running server -c<input> Execute commands from file or string -d Enable debugging output -g Enable GZIP support -h<port> Set port of HTTP server -l Start in local mode -n<name> Set host name of database server -p<port> Set port of database server -s<port> Specify port to stop HTTP server -S Start as service -U<name> Specify username -z Suppress logging
The meaning of all options is listed in the following table (equivalent database options are shown in the table as well). For the examples to work, it might be necessary to escape some characters depending on your Operating System.
Flag | Description | Option | Default | Examples |
---|---|---|---|---|
stop
|
Stops a local HTTP server and quits. The database server will be stopped as well, unless -l is specified.
|
pom.xml
|
||
-c<input>
|
Executes commands. If the specified input is a valid URI or file reference, this file will be evaluated as Command Script. | -c"open database"
| ||
-e
|
Enables debugging output. Debugging information is output to standard error. | DEBUG
|
||
-g
|
Enables GZIP support in Jetty. | GZIP
|
||
-h<port>
|
Specifies the port on which the HTTP server will be addressable. | jetty.xml
|
8080
|
-h9999
|
-l
|
Starts the server in local mode, and executes all commands in the embedded database context. | HTTPLOCAL
|
||
-n<name>
|
Specifies the host name on which the server is running. | HOST
|
localhost
|
-nserver.basex.org
|
-p<port>
|
Specifies the port on which the database server will be addressable. | SERVERPORT
|
1984
|
-p9998
|
-s<port>
|
Specifies the port that will be used to stop the HTTP server. | STOPPORT orpom.xml
|
8081
|
|
-S
|
Starts the server as service (i.e., in the background). Use YAJSW, or start BaseX as an ordinary background process to get more options. | |||
-U<name>
|
Specifies a username, which will be used by the HTTP services for opening a new session. | USER
|
-Uadmin
| |
-z
|
Prevents the generation of log files. | LOG
|
Changelog
- Version 10.0
- Updated: Whitespaces are now preserved by default (see
STRIPWS
for more details).
- Version 9.0
- Added: BaseXHTTP, command-line option
-c
. - Updated: BaseXHTTP, command-line option
-c
, additionally accepts valid URLs and file references.
- Version 8.2
- Removed: Event ports,
-e
.
- Version 8.1
- Added: Bind input strings to the query context with
-I
.
- Version 8.0
- Removed: Command-line option
-L
(results will now be automatically separated by newlines).
- Version 7.9
- Added: Runs tests in file or directory with
-t
. - Removed: interactive server mode.
- Version 7.8
- Added: Specify if a query will be executed or parsed only with
-R
.
- Version 7.7
- Added: Bind host to the BaseX Server with
-n
.
- Version 7.5
- Added: detection of Command Scripts.
- Removed: HTTP server flags
-R
,-W
, and-X
.
- Version 7.3
- Updated: all options are now evaluated in the given order.
- Updated: Create main-memory representations for specified sources with
-i
. - Updated: Options
-C
/-c
and-q
/[input]
merged. - Updated: Option
-L
also separates serialized items with newlines (instead of spaces).
- Version 7.2
- Added: RESTXQ Service
- Version 7.1.1
- Added: Options
-C
and-L
in standalone and client mode.
- Version 7.1
- Updated: Multiple query files and
-c
/-i
/-q
flags can be specified.