Skip to content

Commit 8b895b8

Browse files
committed
Update docs
1 parent b3476a1 commit 8b895b8

File tree

3 files changed

+55
-19
lines changed

3 files changed

+55
-19
lines changed

docs-src/commands.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ namespace MyCommandPlugin
5050
## Run a Command
5151

5252
Create a class that extends **InEngine.Core.AbstractPlugin** in the same assembly as the command class.
53-
Add a VerbOptions attribute, from the CommandLine namespace, that defines the name of the command.
53+
Add a VerbOptions attribute, from the **CommandLine** namespace, that defines the name of the command.
54+
55+
This class registers a command in the MyPlugin assembly called "mycommand":
5456

5557
```c#
5658
using CommandLine;
@@ -61,7 +63,7 @@ namespace MyCommandPlugin
6163
{
6264
public class MyPlugin : AbstractPlugin
6365
{
64-
[VerbOption("my-command", HelpText="My example command.")]
66+
[VerbOption("mycommand", HelpText="My example command.")]
6567
public MyCommand MyCommand { get; set; }
6668
}
6769
}
@@ -70,12 +72,12 @@ namespace MyCommandPlugin
7072
Download the InEngine binary distribution, from the [GitHub Releases](https://github.com/InEngine-NET/InEngine.NET/releases) page, that matches the version of the InEngine.Core package you included.
7173

7274
Copy your project's DLLs into the Plugins subdirectory included in the binary distribution.
73-
Add your plugin to the ["Plugins" list in appsettings.config](configuration) at the root of the binary distribution.
75+
Add your plugin to the "Plugins" list in [appsettings.config](configuration) at the root of the binary distribution.
7476

7577
Run your command:
7678

7779
```bash
78-
inengine.exe my-command
80+
inengine.exe mycommand
7981
```
8082

8183
### Writing Output
@@ -149,29 +151,43 @@ public override void Run()
149151

150152
### Running non-.NET Commands
151153

152-
It isn't necessary to create C# classes to utilize InEngine.NET.
153-
Arbitrary commands can be run, with an argument list by leveraging the InEngine.Core plugin's **exec** command.
154+
It is not necessary to create C# classes to utilize InEngine.NET.
155+
Arbitrary external programs can be run, with an optional argument list, by leveraging the InEngine.Core plugin's **exec** command.
154156

155-
This command prints the version of python:
157+
For example, create a python script called **helloworld.py**, make it executable, and add this to it:
156158

157-
```bash
158-
inengine.exe exec -e"python" -a"--version"
159+
```python
160+
#!/usr/bin/env python
161+
162+
print 'Hello, world!'
159163
```
160164

161-
Whitelist the "php" command in the [appsettings.json](configuration) file:
165+
Whitelist the helloworld.py script in the [appsettings.json](configuration) file:
162166

163167
```json
164168
{
165169
"InEngine": {
166170
// ...
167171
"ExecWhitelist": {
168-
"ls": "ls"
172+
"helloworld": "/path/to/helloworld.py"
169173
}
170174
// ...
171175
}
172176
}
173177
```
174178

179+
Now execute it with the **exec** command:
180+
181+
```bash
182+
inengine exec --executable="helloworld"
183+
```
184+
185+
If an external executable requires arguments, use the **--args** argument:
186+
187+
```bash
188+
inengine exec --executable="foo" --args="--version"
189+
```
190+
175191
## View Commands
176192

177193
Run inengine.exe with no arguments to see a list of commands:

docs-src/configuration.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ The **-c, --configuration** argument can also be used to specify an alternate co
1010
"Plugins": [
1111
"path/to/MyCommandPlugin"
1212
],
13+
"ExecWhitelist": {
14+
"foo": "/path/to/foo.exe"
15+
},
16+
"Mail": {
17+
"Host": "localhost",
18+
"Port": 25,
19+
"From": "no-reply@inengine.net"
20+
},
1321
"Queue": {
1422
"UseCompression": false,
1523
"PrimaryQueueConsumers": 16,
@@ -29,9 +37,19 @@ The **-c, --configuration** argument can also be used to specify an alternate co
2937

3038
## Top-level Settings
3139

32-
| Setting | Type | Description |
33-
| ------------------------- | ----------------- | --------------------------------------------------------------------------------- |
34-
| Plugins | array of strings | A list of paths of plugin assemblies, with ".dll" omitted from the assembly name. |
40+
| Setting | Type | Description |
41+
| ------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------- |
42+
| Plugins | array of strings | A list of paths of plugin assemblies, with ".dll" omitted from the assembly name. |
43+
| ExecWhitelist | object | A set of key/value pairs, where the value is the file system path of an executable and the key is a command alias. |
44+
45+
46+
## Mail Settings
47+
48+
| Setting | Type | Description |
49+
| --------- | --------- | ----------------------------------------------------- |
50+
| Host | string | The hostname of an SMTP server. |
51+
| Port | integer | The port of an SMTP server. |
52+
| From | string | The default email address used to send email from. |
3553

3654

3755
## Queue Settings

docs-src/index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,22 @@ inengine.exe queue:consume
5252

5353
There is a special **exec** command in the core plugin that allows for the execution of any program you can run at the command line.
5454

55-
For example, create a python script called **helloworld.py** that contains this:
55+
For example, create a python script called **helloworld.py**, make it executable, and add this to it:
5656

5757
```python
58+
#!/usr/bin/env python
59+
5860
print 'Hello, world!'
5961
```
6062

61-
Whitelist the "python" command in the [appsettings.json](configuration) file:
63+
Whitelist the "helloworld" executable in the [appsettings.json](configuration) file:
6264

6365
```json
6466
{
6567
"InEngine": {
6668
// ...
6769
"ExecWhitelist": {
68-
"python": "/usr/bin/python"
70+
"helloworld": "/path/to/helloworld.py"
6971
}
7072
// ...
7173
}
@@ -75,7 +77,7 @@ Whitelist the "python" command in the [appsettings.json](configuration) file:
7577
Now execute it with the **exec** command:
7678

7779
```bash
78-
inengine exe --command=python --args=helloworld.py
80+
inengine exec --executable="helloworld"
7981
```
8082

8183
Why would you want to do this?
@@ -84,5 +86,5 @@ It opens up the possibility of running shell scripts, ETLs, Java programs, etc.
8486
The example python script can be queued:
8587

8688
```bash
87-
inengine queue:publish --command-plugin=InEngine.Core --command-verb=exec --args="executable=python" "args=helloworld.py"
89+
inengine queue:publish --command-plugin=InEngine.Core --command-verb=exec --args="executable=helloworld"
8890
```

0 commit comments

Comments
 (0)