Documentation: Usage chapter.
h3rald h3rald@h3rald.com
Sun, 03 May 2015 20:24:52 +0200
3 files changed,
133 insertions(+),
3 deletions(-)
M
admin/LiteStore_UserGuide.htm
→
admin/LiteStore_UserGuide.htm
@@ -111,7 +111,12 @@ </ul>
</li> <li><a href="#Usage">Usage</a> <ul> - <li><a href="#Command.Line.Syntax">Command Line Syntax</a></li> + <li><a href="#Command.Line.Syntax">Command Line Syntax</a> + <ul> + <li><a href="#Commands">Commands</a></li> + <li><a href="#Options">Options</a></li> + </ul> + </li> <li><a href="#Examples">Examples</a> <ul> <li><a href="#Starting.the.HTTP.Server">Starting the HTTP Server</a></li>@@ -306,17 +311,84 @@ <h2 id="Usage">Usage<a href="#document-top" title="Go to top"></a></h2>
<h3 id="Command.Line.Syntax">Command Line Syntax<a href="#document-top" title="Go to top"></a></h3> +<p><span class="kwd">litestore</span> <strong>[</strong> <em>command</em> <strong>]</strong> <strong>[</strong> <em>option1</em>, <em>option2</em>, … <strong>]</strong></p> + +<h4 id="Commands">Commands<a href="#document-top" title="Go to top"></a></h4> + +<ul> +<li><strong>run</strong> — Start LiteStore server (default if no command specified).</li> +<li><strong>delete</strong> — Delete a previously-imported specified directory (requires -d).</li> +<li><strong>import</strong> — Import the specified directory into the datastore (requires -d).</li> +<li><strong>export</strong> — Export the previously-imported specified directory to the current directory (requires -d).</li> +<li><strong>optimize</strong> — Optimize search indexes.</li> +<li><strong>vacuum</strong> — Vacuum datastore.</li> +</ul> + + +<h4 id="Options">Options<a href="#document-top" title="Go to top"></a></h4> + +<ul> +<li><strong>-a</strong>, <strong>--address</strong> — Specify server address (default: 127.0.0.1).</li> +<li><strong>-d</strong>, <strong>--directory</strong> — Specify a directory to import, export, delete, or mount.</li> +<li><strong>-h</strong>, <strong>--help</strong> — Display program usage.</li> +<li><strong>-l</strong>, <strong>--log</strong> — Specify the log level: debug, info, warn, error, none (default: info)</li> +<li><strong>-m</strong>, <strong>--mount</strong> — Mirror database changes to the specified directory on the filesystem.</li> +<li><strong>-p</strong>, <strong>--port</strong> —Specify server port number (default: 9500).</li> +<li><strong>-r</strong>, <strong>--readonly</strong> — Allow only data retrieval operations.</li> +<li><strong>-s</strong>, <strong>--store</strong> — Specify a datastore file (default: data.db)</li> +<li><strong>-v</strong>, <strong>--version</strong> — Display the program version.</li> +</ul> + + <h3 id="Examples">Examples<a href="#document-top" title="Go to top"></a></h3> <h4 id="Starting.the.HTTP.Server">Starting the HTTP Server<a href="#document-top" title="Go to top"></a></h4> +<ul> +<li><p>with default settings:</p> + +<p><span class="cmd">litestore</span></p></li> +<li><p>with custom port (<strong>9700</strong>) and address (<strong>0.0.0.0</strong>):</p> + +<p><span class="cmd">litestore -p:9700 -a:0.0.0.0</span></p></li> +<li><p>in read-only mode with logging level set to <strong>debug</strong>:</p> + +<p><span class="cmd">litestore -r -l:debug</span></p></li> +<li><p>mouting a directory called <strong>admin</strong> (changes will be mirrored to filesystem):</p> + +<p><span class="cmd">litestore -m:admin</span></p></li> +</ul> + + <h4 id="Importing.a.directory">Importing a directory<a href="#document-top" title="Go to top"></a></h4> +<p>Import a directory called <strong>admin</strong>:</p> + +<p><span class="cmd">litestore import -d:admin</span></p> + <h4 id="Exporting.a.directory">Exporting a directory<a href="#document-top" title="Go to top"></a></h4> +<p>Export all documents tagged with <strong>$dir:admin</strong> to a local directory called <strong>admin</strong>:</p> + +<p><span class="cmd">litestore -e:admin</span></p> + <h4 id="Deleting.documents.within.a.directory">Deleting documents within a directory<a href="#document-top" title="Go to top"></a></h4> +<p>Delete all documents tagged with <strong>$dir:admin</strong>:</p> + +<p><span class="cmd">litestore -d:admin</span></p> + <h4 id="Performing.maintenance.operations">Performing maintenance operations<a href="#document-top" title="Go to top"></a></h4> + +<ul> +<li><p>vacuum:</p> + +<p><span class="cmd">litestore vacuum</span></p></li> +<li><p>optimize search index:</p> + +<p><span class="cmd">litestore optimize</span></p></li> +</ul> + <h2 id="REST.API.Reference">REST API Reference<a href="#document-top" title="Go to top"></a></h2>
M
admin/md/usage.md
→
admin/md/usage.md
@@ -2,14 +2,72 @@ ## Usage
### Command Line Syntax +[litestore](class:kwd) **[** _command_ **]** **[** _option1_, _option2_, ... **]** + +#### Commands + +* **run** — Start LiteStore server (default if no command specified). +* **delete** — Delete a previously-imported specified directory (requires -d). +* **import** — Import the specified directory into the datastore (requires -d). +* **export** — Export the previously-imported specified directory to the current directory (requires -d). +* **optimize** — Optimize search indexes. +* **vacuum** — Vacuum datastore. + +#### Options + +* **-a**, **-\-address** — Specify server address (default: 127.0.0.1). +* **-d**, **-\-directory** — Specify a directory to import, export, delete, or mount. +* **-h**, **-\-help** — Display program usage. +* **-l**, **-\-log** — Specify the log level: debug, info, warn, error, none (default: info) +* **-m**, **-\-mount** — Mirror database changes to the specified directory on the filesystem. +* **-p**, **-\-port** —Specify server port number (default: 9500). +* **-r**, **-\-readonly** — Allow only data retrieval operations. +* **-s**, **-\-store** — Specify a datastore file (default: data.db) +* **-v**, **-\-version** — Display the program version. + ### Examples #### Starting the HTTP Server +* with default settings: + + [litestore](class:cmd) +* with custom port (**9700**) and address (**0.0.0.0**): + + [litestore -p:9700 -a:0.0.0.0](class:cmd) + +* in read-only mode with logging level set to **debug**: + + [litestore -r -l:debug](class:cmd) + +* mouting a directory called **admin** (changes will be mirrored to filesystem): + + [litestore -m:admin](class:cmd) + #### Importing a directory +Import a directory called **admin**: + +[litestore import -d:admin](class:cmd) + #### Exporting a directory +Export all documents tagged with **$dir:admin** to a local directory called **admin**: + +[litestore -e:admin](class:cmd) + #### Deleting documents within a directory -#### Performing maintenance operations+Delete all documents tagged with **$dir:admin**: + +[litestore -d:admin](class:cmd) + +#### Performing maintenance operations + +* vacuum: + + [litestore vacuum](class:cmd) + +* optimize search index: + + [litestore optimize](class:cmd)
M
lib/cli.nim
→
lib/cli.nim
@@ -60,7 +60,7 @@ Usage:
LS [command] [option1 option2 ...] Commands: - run Starts LiteStore server. + run Start LiteStore server (default if no command specified). delete Delete a previously-imported specified directory (requires -d). import Import the specified directory into the datastore (requires -d). export Export the previously-imported specified directory to the current directory (requires -d).