diff --git a/editions/tw5.com/tiddlers/NamedCommandParameters.tid b/editions/tw5.com/tiddlers/NamedCommandParameters.tid new file mode 100644 index 000000000..997225f83 --- /dev/null +++ b/editions/tw5.com/tiddlers/NamedCommandParameters.tid @@ -0,0 +1,20 @@ +created: 20180626122427188 +modified: 20180626123549204 +tags: [[Using TiddlyWiki on Node.js]] +title: NamedCommandParameters +type: text/vnd.tiddlywiki + +<<.from-version "5.1.18">> Most TiddlyWiki [[Commands]] use a position-based system for their parameters where each parameter must be listed in the precise order defined by the command. Some of the more complex commands offer an alternative scheme of named command parameters. For example, here we provide two parameters named "port" and "host": + +``` +--listen port=8090 host=0.0.0.0 +``` + +Using special characters within a parameter requires quoting. Unix, Linux and the Mac use single quotes, and Windows uses double quotes: + +``` +--listen port=8090 username=joe 'password=s3cret(!' +--listen port=8090 username=joe "password=s3cret(!" +``` + +Note that the quotes are applied to the entire name=value pair, not just to the value part. diff --git a/editions/tw5.com/tiddlers/commands/Commands.tid b/editions/tw5.com/tiddlers/commands/Commands.tid index fc95297db..c103258c3 100644 --- a/editions/tw5.com/tiddlers/commands/Commands.tid +++ b/editions/tw5.com/tiddlers/commands/Commands.tid @@ -1,8 +1,9 @@ created: 20150117174359000 -modified: 20150117205257000 -title: Commands +modified: 20180626122309578 tags: Concepts Reference +title: Commands +type: text/vnd.tiddlywiki -A <<.def command>> is one of the following words, written with a `--` prefix and used as a command-line option to [[TiddlyWiki on Node.js]], indicating which action is desired. +A <<.def command>> is one of the following words, written with a `--` prefix and used as a command-line option under Node.js, indicating which action is desired. See [[Using TiddlyWiki on Node.js]] for details of how to use them. <> diff --git a/editions/tw5.com/tiddlers/nodejs/Using TiddlyWiki on Node.js.tid b/editions/tw5.com/tiddlers/nodejs/Using TiddlyWiki on Node.js.tid index 958f65986..17e7e0841 100644 --- a/editions/tw5.com/tiddlers/nodejs/Using TiddlyWiki on Node.js.tid +++ b/editions/tw5.com/tiddlers/nodejs/Using TiddlyWiki on Node.js.tid @@ -1,10 +1,10 @@ created: 20131219100520659 -modified: 20140920135025757 +modified: 20180626122347768 tags: [[TiddlyWiki on Node.js]] title: Using TiddlyWiki on Node.js type: text/vnd.tiddlywiki -TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on TiddlyWikiFolders, TiddlerFiles and TiddlyWikiFiles. +TiddlyWiki5 includes a set of [[Commands]] for use on the command line to perform an extensive set of operations based on TiddlyWikiFolders, TiddlerFiles and TiddlyWikiFiles. For example, the following command loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in static HTML: @@ -22,6 +22,10 @@ The commands and their individual arguments follow, each command being identifie tiddlywiki [] [-- [[,]]] ``` -The available commands are: +<<.from-version "5.1.18">> Commands such as the ListenCommand that support large numbers of parameters can use NamedCommandParameters to make things less unwieldy. For example: -<> +``` +tiddlywiki wikipath --listen username=jeremy port=8090 +``` + +See [[Commands]] for a full listing of the available commands.