Skip to content

Commit b32fd7a

Browse files
committed
Add Echo sample command
1 parent 01317f3 commit b32fd7a

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

src/InEngine.Commands/InEngine.Commands.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<Compile Include="..\SharedAssemblyInfo.cs">
4343
<Link>Properties\SharedAssemblyInfo.cs</Link>
4444
</Compile>
45+
<Compile Include="Sample\Echo.cs" />
4546
</ItemGroup>
4647
<ItemGroup>
4748
<Folder Include="Sample\" />

src/InEngine.Commands/Options.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ public class Options : IOptions
1010
[VerbOption("sample:minimal")]
1111
public Minimal Minimal { get; set; }
1212

13+
[VerbOption("sample:echo")]
14+
public Echo Echo { get; set; }
15+
1316
[HelpVerbOption]
1417
public string GetUsage(string verb)
1518
{
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using InEngine.Core;
2+
using System;
3+
using CommandLine;
4+
5+
namespace InEngine.Commands.Sample
6+
{
7+
public class Echo : AbstractCommand
8+
{
9+
[Option("text")]
10+
public string Text { get; set; }
11+
12+
public override CommandResult Run()
13+
{
14+
Console.WriteLine(Text);
15+
return new CommandResult(true);
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)