Skip to content

Commit b38827c

Browse files
committed
Update docs
1 parent 2983db9 commit b38827c

File tree

4 files changed

+67
-31
lines changed

4 files changed

+67
-31
lines changed

docs-src/commands.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,21 @@ InEngineCli.exe -pMyCommandPlugin my-command
108108
Run InEngineCli.exe without any arguments to see a list of arguments.
109109

110110
```text
111-
Available plugins...
112-
InEngine.Commands
113-
InEngine.Core
111+
112+
___ _____ _ _ _ _____ _____
113+
|_ _|_ __ | ____|_ __ __ _(_)_ __ ___ | \ | | ____|_ _|
114+
| || '_ \| _| | '_ \ / _` | | '_ \ / _ \ | \| | _| | |
115+
| || | | | |___| | | | (_| | | | | | __/_| |\ | |___ | |
116+
|___|_| |_|_____|_| |_|\__, |_|_| |_|\___(_|_| \_|_____| |_|
117+
|___/
118+
119+
Usage:
120+
-p[<plugin_name>] [<command_name>]
121+
122+
Plugins:
123+
InEngine.Commands
124+
InEngine.Core
125+
114126
```
115127

116128
## Discover Commands in a Plugin
@@ -125,17 +137,23 @@ The **InEngine.Core** library is itself a plugin that contains queue related com
125137
As an example, this is the help output for the core plugin.
126138

127139
```text
128-
InEngine 3.x
129-
Copyright © Ethan Hann 2017
130-
131-
queue:publish Publish a command message to a queue.
132-
133-
queue:consume Consume one or more command messages from the queue.
134-
135-
queue:length Get the number of messages in the primary and secondary
136-
queues.
137140
138-
queue:clear Clear the primary and secondary queues.
141+
___ _____ _ _ _ _____ _____
142+
|_ _|_ __ | ____|_ __ __ _(_)_ __ ___ | \ | | ____|_ _|
143+
| || '_ \| _| | '_ \ / _` | | '_ \ / _ \ | \| | _| | |
144+
| || | | | |___| | | | (_| | | | | | __/_| |\ | |___ | |
145+
|___|_| |_|_____|_| |_|\__, |_|_| |_|\___(_|_| \_|_____| |_|
146+
|___/
147+
148+
Plugin: InEngine.Core
149+
150+
Commands:
151+
null A null operation command. Literally does nothing.
152+
echo Echo some text to the console. Useful for end-to-end testing.
153+
queue:publish Publish a command message to a queue.
154+
queue:consume Consume one or more command messages from the queue.
155+
queue:length Get the number of messages in the primary and secondary queues.
156+
queue:clear Clear the primary and secondary queues.
139157
```
140158

141159
## Print Help Text for a Plugin's Commands

docs/commands/index.html

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,21 @@ <h2 id="run-a-command">Run a Command</h2>
197197

198198
<h2 id="discover-command-plugins">Discover Command Plugins</h2>
199199
<p>Run InEngineCli.exe without any arguments to see a list of arguments.</p>
200-
<pre><code class="text">Available plugins...
201-
InEngine.Commands
202-
InEngine.Core
200+
<pre><code class="text">
201+
___ _____ _ _ _ _____ _____
202+
|_ _|_ __ | ____|_ __ __ _(_)_ __ ___ | \ | | ____|_ _|
203+
| || '_ \| _| | '_ \ / _` | | '_ \ / _ \ | \| | _| | |
204+
| || | | | |___| | | | (_| | | | | | __/_| |\ | |___ | |
205+
|___|_| |_|_____|_| |_|\__, |_|_| |_|\___(_|_| \_|_____| |_|
206+
|___/
207+
208+
Usage:
209+
-p[&lt;plugin_name&gt;] [&lt;command_name&gt;]
210+
211+
Plugins:
212+
InEngine.Commands
213+
InEngine.Core
214+
203215
</code></pre>
204216

205217
<h2 id="discover-commands-in-a-plugin">Discover Commands in a Plugin</h2>
@@ -209,17 +221,23 @@ <h2 id="discover-commands-in-a-plugin">Discover Commands in a Plugin</h2>
209221

210222
<p>The <strong>InEngine.Core</strong> library is itself a plugin that contains queue related commands.
211223
As an example, this is the help output for the core plugin.</p>
212-
<pre><code class="text">InEngine 3.x
213-
Copyright © Ethan Hann 2017
214-
215-
queue:publish Publish a command message to a queue.
216-
217-
queue:consume Consume one or more command messages from the queue.
218-
219-
queue:length Get the number of messages in the primary and secondary
220-
queues.
221-
222-
queue:clear Clear the primary and secondary queues.
224+
<pre><code class="text">
225+
___ _____ _ _ _ _____ _____
226+
|_ _|_ __ | ____|_ __ __ _(_)_ __ ___ | \ | | ____|_ _|
227+
| || '_ \| _| | '_ \ / _` | | '_ \ / _ \ | \| | _| | |
228+
| || | | | |___| | | | (_| | | | | | __/_| |\ | |___ | |
229+
|___|_| |_|_____|_| |_|\__, |_|_| |_|\___(_|_| \_|_____| |_|
230+
|___/
231+
232+
Plugin: InEngine.Core
233+
234+
Commands:
235+
null A null operation command. Literally does nothing.
236+
echo Echo some text to the console. Useful for end-to-end testing.
237+
queue:publish Publish a command message to a queue.
238+
queue:consume Consume one or more command messages from the queue.
239+
queue:length Get the number of messages in the primary and secondary queues.
240+
queue:clear Clear the primary and secondary queues.
223241
</code></pre>
224242

225243
<h2 id="print-help-text-for-a-plugins-commands">Print Help Text for a Plugin's Commands</h2>

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,5 @@ <h4 class="modal-title" id="exampleModalLabel">Search</h4>
146146

147147
<!--
148148
MkDocs version : 0.16.3
149-
Build Date UTC : 2017-11-22 03:36:04
149+
Build Date UTC : 2017-11-22 03:38:12
150150
-->

docs/mkdocs/search_index.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
{
1919
"location": "/commands/",
20-
"text": "Commands\n\n\nCommands are the fundamental abstraction used to run custom logic.\n\n\nCreate a Command\n\n\nThe InEngine.Core package is required. Install it into your own Visual Studio project.\n\n\nPackage Manager\n\n\nInstall-Package InEngine.Core\n\n\n\n\nNuget CLI\n\n\nnuget install InEgine.Core\n\n\n\n\n.NET CLI\n\n\ndotnet add package InEngine.Core\n\n\n\n\nPaket CLI\n\n\npaket add InEngine.Core\n\n\n\n\nAdding a class that implements \nInEngine.Core.ICommand\n is the simplest way to create a command.\n\n\nusing System;\nusing InEngine.Core;\n\nnamespace MyCommandPlugin\n{\n public class MyCommand : ICommand\n {\n public CommandResult Run()\n {\n Console.WriteLine(\nHello, world!\n);\n return new CommandResult(true);\n }\n }\n}\n\n\n\n\nExtending the \nInEngine.Core.AbstractCommand\n class adds extra functionality, like a logger, a progress bar, and the ability to schedule the command using the scheduler.\nMinimally, the Run method should be overridden.\n\n\nusing System;\nusing InEngine.Core;\n\nnamespace MyCommandPlugin\n{\n public class MyCommand : ICommand\n {\n public override CommandResult Run()\n {\n Console.WriteLine(\nHello, world!\n);\n return new CommandResult(true);\n }\n }\n}\n\n\n\n\nRun a Command\n\n\nCreate a class that implements \nInEngine.Core.IOptions\n in the same assembly as the command class.\nAdd a VerbOptions attribute from the CommandLine namespace that defines the name of the command and optional help text.\nThe help text can be auto-generated from the attribute or manually specified in the GetUsage method. \n\n\nusing CommandLine;\nusing CommandLine.Text;\nusing InEngine.Core;\n\nnamespace MyCommandPlugin\n{\n public class MyOptions : IOptions\n {\n [VerbOption(\nmy-command\n, HelpText=\nMy example command.\n)]\n public MyCommand MyCommand { get; set; }\n\n [HelpVerbOption]\n public string GetUsage(string verb)\n {\n return HelpText.AutoBuild(this, verb);\n }\n }\n}\n\n\n\n\nDownload the InEngineCli tool that matches the version of the InEngine.Core package you included from the \nGitHub Releases\n page.\n\n\nCopy your project's DLLs into the same directory as InEngineCli.exe.\n\n\nRun your command...\n\n\nInEngineCli.exe -pMyCommandPlugin my-command\n\n\n\n\nDiscover Command Plugins\n\n\nRun InEngineCli.exe without any arguments to see a list of arguments.\n\n\nAvailable plugins... \nInEngine.Commands\nInEngine.Core\n\n\n\n\nDiscover Commands in a Plugin\n\n\nRun InEngineCli.exe with only the plugin specified.\n\n\nInEngineCli.exe -pInEngine.Core\n\n\n\n\nThe \nInEngine.Core\n library is itself a plugin that contains queue related commands. \nAs an example, this is the help output for the core plugin.\n\n\nInEngine 3.x\nCopyright \u00a9 Ethan Hann 2017\n\n queue:publish Publish a command message to a queue.\n\n queue:consume Consume one or more command messages from the queue.\n\n queue:length Get the number of messages in the primary and secondary \n queues.\n\n queue:clear Clear the primary and secondary queues.\n\n\n\n\nPrint Help Text for a Plugin's Commands\n\n\nRun the command with the -h or --help arguments.\n\n\nInEngineCli.exe -pInEngine.Core queue:clear -h\n\n\n\n\nThe \nInEngine.Core\n plugin's command to clear the InEngine.NET's queues produces this help message. \n\n\nInEngine 3.x\nCopyright \u00a9 Ethan Hann 2017\n\n --processing-queue Clear the processing queue.\n\n --secondary Clear the secondary queue.\n\n\n\n\nWriting Output\n\n\nThe \nInEngine.Core.AbstractCommand\n class provides some helper functions to output text to the console: \n\n\nIWrite Newline();\nIWrite Info(string val);\nIWrite Warning(string val);\nIWrite Error(string val);\nIWrite Line(string val);\n\n\n\n\npublic override CommandResult Run()\n{\n Info(\nDisplay some information\n);\n}\n\n\n\n\nDisplay an error message, use the Error method.\n\n\nError(\nDisplay some information\n);\n\n\n\n\nDisplay a warning message, use the Warning method.\n\n\nError(\nDisplay some information\n);\n\n\n\n\nInfo, Error, and Warning messages are display in green, red, and yellow, respectively.\nIf you want to display an uncolored line, use the Line method. \nLine(\"This is a plain line.\");\n\n\nLogging\n\n\nThe \nInEngine.Core.AbstractCommand\n class provides a Logger property. It implements the \nNLog.ILogger\n interface.\n\n\npublic override CommandResult Run()\n{\n Logger.Trace(\nSample trace message\n);\n Logger.Debug(\nSample debug message\n);\n Logger.Info(\nSample informational message\n);\n Logger.Warn(\nSample warning message\n);\n Logger.Error(\nSample error message\n);\n Logger.Fatal(\nSample fatal error message\n);\n return new CommandResult(true);\n}\n\n\n\n\nSetup an \nNLog configuration\n file, something like this...\n\n\n?xml version=\n1.0\n encoding=\nutf-8\n ?\n\n\nnlog xmlns=\nhttp://www.nlog-project.org/schemas/NLog.xsd\n\n xmlns:xsi=\nhttp://www.w3.org/2001/XMLSchema-instance\n\n\n \ntargets\n\n \ntarget name=\nlogfile\n xsi:type=\nFile\n fileName=\nfile.txt\n /\n\n \ntarget name=\nconsole\n xsi:type=\nConsole\n /\n\n \n/targets\n\n\n \nrules\n\n \nlogger name=\n*\n minlevel=\nTrace\n writeTo=\nlogfile\n /\n\n \nlogger name=\n*\n minlevel=\nInfo\n writeTo=\nconsole\n /\n\n \n/rules\n\n\n/nlog\n\n\n\n\n\nProgress Bar\n\n\nThe \nInEngine.Core.AbstractCommand\n class provides a ProgressBar property. This is how it is used.\n\n\npublic override CommandResult Run()\n{\n // Define the ticks (aka steps) for the command...\n var maxTicks = 100000;\n SetProgressBarMaxTicks(maxTicks);\n\n // Do some work...\n for (var i = 0; i \n= maxTicks;i++)\n {\n // Update the command's progress\n UpdateProgress(i);\n }\n\n return new CommandResult(true);\n}",
20+
"text": "Commands\n\n\nCommands are the fundamental abstraction used to run custom logic.\n\n\nCreate a Command\n\n\nThe InEngine.Core package is required. Install it into your own Visual Studio project.\n\n\nPackage Manager\n\n\nInstall-Package InEngine.Core\n\n\n\n\nNuget CLI\n\n\nnuget install InEgine.Core\n\n\n\n\n.NET CLI\n\n\ndotnet add package InEngine.Core\n\n\n\n\nPaket CLI\n\n\npaket add InEngine.Core\n\n\n\n\nAdding a class that implements \nInEngine.Core.ICommand\n is the simplest way to create a command.\n\n\nusing System;\nusing InEngine.Core;\n\nnamespace MyCommandPlugin\n{\n public class MyCommand : ICommand\n {\n public CommandResult Run()\n {\n Console.WriteLine(\nHello, world!\n);\n return new CommandResult(true);\n }\n }\n}\n\n\n\n\nExtending the \nInEngine.Core.AbstractCommand\n class adds extra functionality, like a logger, a progress bar, and the ability to schedule the command using the scheduler.\nMinimally, the Run method should be overridden.\n\n\nusing System;\nusing InEngine.Core;\n\nnamespace MyCommandPlugin\n{\n public class MyCommand : ICommand\n {\n public override CommandResult Run()\n {\n Console.WriteLine(\nHello, world!\n);\n return new CommandResult(true);\n }\n }\n}\n\n\n\n\nRun a Command\n\n\nCreate a class that implements \nInEngine.Core.IOptions\n in the same assembly as the command class.\nAdd a VerbOptions attribute from the CommandLine namespace that defines the name of the command and optional help text.\nThe help text can be auto-generated from the attribute or manually specified in the GetUsage method. \n\n\nusing CommandLine;\nusing CommandLine.Text;\nusing InEngine.Core;\n\nnamespace MyCommandPlugin\n{\n public class MyOptions : IOptions\n {\n [VerbOption(\nmy-command\n, HelpText=\nMy example command.\n)]\n public MyCommand MyCommand { get; set; }\n\n [HelpVerbOption]\n public string GetUsage(string verb)\n {\n return HelpText.AutoBuild(this, verb);\n }\n }\n}\n\n\n\n\nDownload the InEngineCli tool that matches the version of the InEngine.Core package you included from the \nGitHub Releases\n page.\n\n\nCopy your project's DLLs into the same directory as InEngineCli.exe.\n\n\nRun your command...\n\n\nInEngineCli.exe -pMyCommandPlugin my-command\n\n\n\n\nDiscover Command Plugins\n\n\nRun InEngineCli.exe without any arguments to see a list of arguments.\n\n\n\n ___ _____ _ _ _ _____ _____ \n |_ _|_ __ | ____|_ __ __ _(_)_ __ ___ | \\ | | ____|_ _|\n | || '_ \\| _| | '_ \\ / _` | | '_ \\ / _ \\ | \\| | _| | | \n | || | | | |___| | | | (_| | | | | | __/_| |\\ | |___ | | \n |___|_| |_|_____|_| |_|\\__, |_|_| |_|\\___(_|_| \\_|_____| |_| \n |___/ \n\nUsage:\n -p[\nplugin_name\n] [\ncommand_name\n]\n\nPlugins:\n InEngine.Commands\n InEngine.Core\n\n\n\n\n\nDiscover Commands in a Plugin\n\n\nRun InEngineCli.exe with only the plugin specified.\n\n\nInEngineCli.exe -pInEngine.Core\n\n\n\n\nThe \nInEngine.Core\n library is itself a plugin that contains queue related commands. \nAs an example, this is the help output for the core plugin.\n\n\n\n ___ _____ _ _ _ _____ _____ \n |_ _|_ __ | ____|_ __ __ _(_)_ __ ___ | \\ | | ____|_ _|\n | || '_ \\| _| | '_ \\ / _` | | '_ \\ / _ \\ | \\| | _| | | \n | || | | | |___| | | | (_| | | | | | __/_| |\\ | |___ | | \n |___|_| |_|_____|_| |_|\\__, |_|_| |_|\\___(_|_| \\_|_____| |_| \n |___/ \n\nPlugin: InEngine.Core\n\nCommands:\n null A null operation command. Literally does nothing.\n echo Echo some text to the console. Useful for end-to-end testing.\n queue:publish Publish a command message to a queue.\n queue:consume Consume one or more command messages from the queue.\n queue:length Get the number of messages in the primary and secondary queues.\n queue:clear Clear the primary and secondary queues.\n\n\n\n\nPrint Help Text for a Plugin's Commands\n\n\nRun the command with the -h or --help arguments.\n\n\nInEngineCli.exe -pInEngine.Core queue:clear -h\n\n\n\n\nThe \nInEngine.Core\n plugin's command to clear the InEngine.NET's queues produces this help message. \n\n\nInEngine 3.x\nCopyright \u00a9 Ethan Hann 2017\n\n --processing-queue Clear the processing queue.\n\n --secondary Clear the secondary queue.\n\n\n\n\nWriting Output\n\n\nThe \nInEngine.Core.AbstractCommand\n class provides some helper functions to output text to the console: \n\n\nIWrite Newline();\nIWrite Info(string val);\nIWrite Warning(string val);\nIWrite Error(string val);\nIWrite Line(string val);\n\n\n\n\npublic override CommandResult Run()\n{\n Info(\nDisplay some information\n);\n}\n\n\n\n\nDisplay an error message, use the Error method.\n\n\nError(\nDisplay some information\n);\n\n\n\n\nDisplay a warning message, use the Warning method.\n\n\nError(\nDisplay some information\n);\n\n\n\n\nInfo, Error, and Warning messages are display in green, red, and yellow, respectively.\nIf you want to display an uncolored line, use the Line method. \nLine(\"This is a plain line.\");\n\n\nLogging\n\n\nThe \nInEngine.Core.AbstractCommand\n class provides a Logger property. It implements the \nNLog.ILogger\n interface.\n\n\npublic override CommandResult Run()\n{\n Logger.Trace(\nSample trace message\n);\n Logger.Debug(\nSample debug message\n);\n Logger.Info(\nSample informational message\n);\n Logger.Warn(\nSample warning message\n);\n Logger.Error(\nSample error message\n);\n Logger.Fatal(\nSample fatal error message\n);\n return new CommandResult(true);\n}\n\n\n\n\nSetup an \nNLog configuration\n file, something like this...\n\n\n?xml version=\n1.0\n encoding=\nutf-8\n ?\n\n\nnlog xmlns=\nhttp://www.nlog-project.org/schemas/NLog.xsd\n\n xmlns:xsi=\nhttp://www.w3.org/2001/XMLSchema-instance\n\n\n \ntargets\n\n \ntarget name=\nlogfile\n xsi:type=\nFile\n fileName=\nfile.txt\n /\n\n \ntarget name=\nconsole\n xsi:type=\nConsole\n /\n\n \n/targets\n\n\n \nrules\n\n \nlogger name=\n*\n minlevel=\nTrace\n writeTo=\nlogfile\n /\n\n \nlogger name=\n*\n minlevel=\nInfo\n writeTo=\nconsole\n /\n\n \n/rules\n\n\n/nlog\n\n\n\n\n\nProgress Bar\n\n\nThe \nInEngine.Core.AbstractCommand\n class provides a ProgressBar property. This is how it is used.\n\n\npublic override CommandResult Run()\n{\n // Define the ticks (aka steps) for the command...\n var maxTicks = 100000;\n SetProgressBarMaxTicks(maxTicks);\n\n // Do some work...\n for (var i = 0; i \n= maxTicks;i++)\n {\n // Update the command's progress\n UpdateProgress(i);\n }\n\n return new CommandResult(true);\n}",
2121
"title": "Commands"
2222
},
2323
{
@@ -37,12 +37,12 @@
3737
},
3838
{
3939
"location": "/commands/#discover-command-plugins",
40-
"text": "Run InEngineCli.exe without any arguments to see a list of arguments. Available plugins... \nInEngine.Commands\nInEngine.Core",
40+
"text": "Run InEngineCli.exe without any arguments to see a list of arguments. \n ___ _____ _ _ _ _____ _____ \n |_ _|_ __ | ____|_ __ __ _(_)_ __ ___ | \\ | | ____|_ _|\n | || '_ \\| _| | '_ \\ / _` | | '_ \\ / _ \\ | \\| | _| | | \n | || | | | |___| | | | (_| | | | | | __/_| |\\ | |___ | | \n |___|_| |_|_____|_| |_|\\__, |_|_| |_|\\___(_|_| \\_|_____| |_| \n |___/ \n\nUsage:\n -p[ plugin_name ] [ command_name ]\n\nPlugins:\n InEngine.Commands\n InEngine.Core",
4141
"title": "Discover Command Plugins"
4242
},
4343
{
4444
"location": "/commands/#discover-commands-in-a-plugin",
45-
"text": "Run InEngineCli.exe with only the plugin specified. InEngineCli.exe -pInEngine.Core The InEngine.Core library is itself a plugin that contains queue related commands. \nAs an example, this is the help output for the core plugin. InEngine 3.x\nCopyright \u00a9 Ethan Hann 2017\n\n queue:publish Publish a command message to a queue.\n\n queue:consume Consume one or more command messages from the queue.\n\n queue:length Get the number of messages in the primary and secondary \n queues.\n\n queue:clear Clear the primary and secondary queues.",
45+
"text": "Run InEngineCli.exe with only the plugin specified. InEngineCli.exe -pInEngine.Core The InEngine.Core library is itself a plugin that contains queue related commands. \nAs an example, this is the help output for the core plugin. \n ___ _____ _ _ _ _____ _____ \n |_ _|_ __ | ____|_ __ __ _(_)_ __ ___ | \\ | | ____|_ _|\n | || '_ \\| _| | '_ \\ / _` | | '_ \\ / _ \\ | \\| | _| | | \n | || | | | |___| | | | (_| | | | | | __/_| |\\ | |___ | | \n |___|_| |_|_____|_| |_|\\__, |_|_| |_|\\___(_|_| \\_|_____| |_| \n |___/ \n\nPlugin: InEngine.Core\n\nCommands:\n null A null operation command. Literally does nothing.\n echo Echo some text to the console. Useful for end-to-end testing.\n queue:publish Publish a command message to a queue.\n queue:consume Consume one or more command messages from the queue.\n queue:length Get the number of messages in the primary and secondary queues.\n queue:clear Clear the primary and secondary queues.",
4646
"title": "Discover Commands in a Plugin"
4747
},
4848
{

0 commit comments

Comments
 (0)