You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Second, download the CLI and/or the Scheduler from a release that matches the version of the InEngine.Core package you included.
31
-
32
-
Releases are found on GitHub: https://github.com/InEngine-NET/InEngine.NET/releases
33
-
34
-
## Create a Command
35
-
36
32
Add a class that implements **InEngine.Core.ICommand** or extends **InEngine.Core.AbstractCommand**.
33
+
The **AbstractCommand** class adds extra functionality, like a logger, a progress bar, and the ability to schedule the command using the scheduler.
34
+
Minimally, the Run method should be overridden.
37
35
38
-
```c#
36
+
```csharp
37
+
usingSystem;
39
38
usingInEngine.Core;
40
39
41
40
namespaceMyCommands
@@ -44,33 +43,55 @@ namespace MyCommands
44
43
{
45
44
publicCommandResultRun()
46
45
{
46
+
Console.WriteLine("Hello, world!");
47
47
returnnewCommandResult(true);
48
48
}
49
49
}
50
50
}
51
51
```
52
52
53
-
The **AbstractCommand** class adds extra functionality, like a logger, a progress bar, and the ability to schedule the command using the scheduler.
54
-
Minimally, the Run method should be overridden.
55
-
53
+
Create a class that implements **InEngine.Core.IOptions** in the same assembly as the command class.
54
+
Add VerbOptions from the CommandLine namespace.
55
+
The help text can be auto-generated or manually specified.
56
56
57
-
```c#
57
+
```csharp
58
+
usingCommandLine;
59
+
usingCommandLine.Text;
58
60
usingInEngine.Core;
59
61
60
-
namespaceMyCommands
62
+
namespaceInEngine.Commands
61
63
{
62
-
publicclassMyCommand : AbstractCommand
64
+
publicclassMyOptions : IOptions
63
65
{
64
-
publicoverrideCommandResultRun()
66
+
[VerbOption("my-command", HelpText="My example command.")]
67
+
publicMyCommandMyCommand { get; set; }
68
+
69
+
[HelpVerbOption]
70
+
publicstringGetUsage(stringverb)
65
71
{
66
-
returnnewCommandResult(true);
72
+
returnHelpText.AutoBuild(this, verb);
67
73
}
68
74
}
69
75
}
70
76
```
71
77
78
+
# Run the Command
79
+
80
+
Second, download the InEngineCli tool that matches the version of the InEngine.Core package you included from the [GitHub Releases](https://github.com/InEngine-NET/InEngine.NET/releases) page.
81
+
82
+
Copy your project's DLLs into the same directory as InEngineCli.exe.
<p>Second, download the CLI and/or the Scheduler from a release that matches the version of the InEngine.Core package you included.</p>
96
-
<p>Releases are found on GitHub: https://github.com/InEngine-NET/InEngine.NET/releases</p>
97
-
<h2id="create-a-command">Create a Command</h2>
98
-
<p>Add a class that implements <strong>InEngine.Core.ICommand</strong> or extends <strong>InEngine.Core.AbstractCommand</strong>. </p>
99
-
<pre><codeclass="c#">using InEngine.Core;
97
+
<p>Add a class that implements <strong>InEngine.Core.ICommand</strong> or extends <strong>InEngine.Core.AbstractCommand</strong>.
98
+
The <strong>AbstractCommand</strong> class adds extra functionality, like a logger, a progress bar, and the ability to schedule the command using the scheduler.
99
+
Minimally, the Run method should be overridden.</p>
100
+
<pre><codeclass="csharp">using System;
101
+
using InEngine.Core;
100
102
101
103
namespace MyCommands
102
104
{
103
105
public class MyCommand : ICommand
104
106
{
105
107
public CommandResult Run()
106
108
{
109
+
Console.WriteLine("Hello, world!");
107
110
return new CommandResult(true);
108
111
}
109
112
}
110
113
}
111
114
</code></pre>
112
115
113
-
<p>The <strong>AbstractCommand</strong> class adds extra functionality, like a logger, a progress bar, and the ability to schedule the command using the scheduler.
114
-
Minimally, the Run method should be overridden.</p>
115
-
<pre><codeclass="c#">using InEngine.Core;
116
+
<p>Create a class that implements <strong>InEngine.Core.IOptions</strong> in the same assembly as the command class.
117
+
Add VerbOptions from the CommandLine namespace.
118
+
The help text can be auto-generated or manually specified. </p>
119
+
<pre><codeclass="csharp">using CommandLine;
120
+
using CommandLine.Text;
121
+
using InEngine.Core;
116
122
117
-
namespace MyCommands
123
+
namespace InEngine.Commands
118
124
{
119
-
public class MyCommand : AbstractCommand
125
+
public class MyOptions : IOptions
120
126
{
121
-
public override CommandResult Run()
127
+
[VerbOption("my-command", HelpText="My example command.")]
128
+
public MyCommand MyCommand { get; set; }
129
+
130
+
[HelpVerbOption]
131
+
public string GetUsage(string verb)
122
132
{
123
-
return new CommandResult(true);
133
+
return HelpText.AutoBuild(this, verb);
124
134
}
125
135
}
126
136
}
137
+
</code></pre>
138
+
139
+
<h1id="run-the-command">Run the Command</h1>
140
+
<p>Second, download the InEngineCli tool that matches the version of the InEngine.Core package you included from the <ahref="https://github.com/InEngine-NET/InEngine.NET/releases">GitHub Releases</a> page.</p>
141
+
<p>Copy your project's DLLs into the same directory as InEngineCli.exe.</p>
Copy file name to clipboardExpand all lines: docs/mkdocs/search_index.json
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"docs": [
3
3
{
4
4
"location": "/",
5
-
"text": "What is this?\n\n\nInEngine.NET is a background commands processing server. \nIt allows commands to be queued, scheduled, and ran directly. \n\n\nInstall\n\n\nFirst, install the InEngine.Core package 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\nSecond, download the CLI and/or the Scheduler from a release that matches the version of the InEngine.Core package you included.\n\n\nReleases are found on GitHub: https://github.com/InEngine-NET/InEngine.NET/releases\n\n\nCreate a Command\n\n\nAdd a class that implements \nInEngine.Core.ICommand\n or extends \nInEngine.Core.AbstractCommand\n. \n\n\nusing InEngine.Core;\n\nnamespace MyCommands\n{\n public class MyCommand : ICommand\n {\n public CommandResult Run()\n {\n return new CommandResult(true);\n }\n }\n}\n\n\n\n\nThe \nAbstractCommand\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 InEngine.Core;\n\nnamespace MyCommands\n{\n public class MyCommand : AbstractCommand\n {\n public override CommandResult Run()\n {\n return new CommandResult(true);\n }\n }\n}",
5
+
"text": "What is this?\n\n\nInEngine.NET is a background commands processing server. \nIt allows commands to be queued, scheduled, and ran directly. \n\n\nHow to Get Started\n\n\nCreate a Command\n\n\nFirst, install the InEngine.Core package 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\nAdd a class that implements \nInEngine.Core.ICommand\n or extends \nInEngine.Core.AbstractCommand\n. \nThe \nAbstractCommand\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 MyCommands\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\nCreate a class that implements \nInEngine.Core.IOptions\n in the same assembly as the command class.\nAdd VerbOptions from the CommandLine namespace.\nThe help text can be auto-generated or manually specified. \n\n\nusing CommandLine;\nusing CommandLine.Text;\nusing InEngine.Core;\n\nnamespace InEngine.Commands\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\nRun the Command\n\n\nSecond, download 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 -pMyCommands my-command",
6
6
"title": "Getting Started"
7
7
},
8
8
{
@@ -11,14 +11,19 @@
11
11
"title": "What is this?"
12
12
},
13
13
{
14
-
"location": "/#install",
15
-
"text": "First, install the InEngine.Core package into your own Visual Studio project. Package Manager Install-Package InEngine.Core Nuget CLI nuget install InEgine.Core .NET CLI dotnet add package InEngine.Core Paket CLI paket add InEngine.Core Second, download the CLI and/or the Scheduler from a release that matches the version of the InEngine.Core package you included. Releases are found on GitHub: https://github.com/InEngine-NET/InEngine.NET/releases",
16
-
"title": "Install"
14
+
"location": "/#how-to-get-started",
15
+
"text": "",
16
+
"title": "How to Get Started"
17
17
},
18
18
{
19
19
"location": "/#create-a-command",
20
-
"text": "Add a class that implements InEngine.Core.ICommand or extends InEngine.Core.AbstractCommand . using InEngine.Core;\n\nnamespace MyCommands\n{\n public class MyCommand : ICommand\n {\n public CommandResult Run()\n {\n return new CommandResult(true);\n }\n }\n} The AbstractCommand 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. using InEngine.Core;\n\nnamespace MyCommands\n{\n public class MyCommand : AbstractCommand\n {\n public override CommandResult Run()\n {\n return new CommandResult(true);\n }\n }\n}",
20
+
"text": "First, install the InEngine.Core package into your own Visual Studio project. Package Manager Install-Package InEngine.Core Nuget CLI nuget install InEgine.Core .NET CLI dotnet add package InEngine.Core Paket CLI paket add InEngine.Core Add a class that implements InEngine.Core.ICommand or extends InEngine.Core.AbstractCommand . \nThe AbstractCommand 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. using System;\nusing InEngine.Core;\n\nnamespace MyCommands\n{\n public class MyCommand : ICommand\n {\n public CommandResult Run()\n {\n Console.WriteLine( Hello, world! );\n return new CommandResult(true);\n }\n }\n} Create a class that implements InEngine.Core.IOptions in the same assembly as the command class.\nAdd VerbOptions from the CommandLine namespace.\nThe help text can be auto-generated or manually specified. using CommandLine;\nusing CommandLine.Text;\nusing InEngine.Core;\n\nnamespace InEngine.Commands\n{\n public class MyOptions : IOptions\n {\n [VerbOption( my-command , HelpText= My example command. )]\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}",
21
21
"title": "Create a Command"
22
+
},
23
+
{
24
+
"location": "/#run-the-command",
25
+
"text": "Second, download the InEngineCli tool that matches the version of the InEngine.Core package you included from the GitHub Releases page. Copy your project's DLLs into the same directory as InEngineCli.exe. Run your command... InEngineCli.exe -pMyCommands my-command",
0 commit comments