Skip to content

Commit 3f1b36d

Browse files
committed
nested commands alias sample
1 parent eb16b4d commit 3f1b36d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ReadMe.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,19 @@ public class Commands
452452
}
453453
```
454454

455+
It also supports aliases for nested commands.
456+
457+
```csharp
458+
var app = ConsoleApp.Create();
459+
460+
app.Add("dotnet package add|dotnet add package", () => { });
461+
app.Add("dotnet package list|dotnet list package", () => { });
462+
app.Add("dotnet package remove|dotnet remove package", () => { });
463+
app.Add("dotnet reference add|dotnet add reference", () => { });
464+
465+
app.Run(args);
466+
```
467+
455468
### Performance of Commands
456469

457470
In `ConsoleAppFramework`, the number and types of registered commands are statically determined at compile time. For example, let's register the following four commands:

0 commit comments

Comments
 (0)