Skip to content

Commit 1401837

Browse files
committed
Update README.md
Documentation
1 parent 3e3c7b2 commit 1401837

1 file changed

Lines changed: 5 additions & 48 deletions

File tree

README.md

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,12 @@
22
#### <center>Pyratron Command Parser Framework</center>
33
<center>[![Build Status](https://travis-ci.org/Pyratron/Command-Parser.svg?branch=master)](https://travis-ci.org/Pyratron/Command-Parser)</center>
44

5-
A simple, lightweight, but powerful command parsing library for use in games and other applications making use of user input commands.
5+
A powerful but simple command parsing library for use in games and other applications making use of user input commands. If you have created a game or application that has the need for command support, this library will easily let you create commands through a fluent interface, add help pages, optional parameters, grouped parameters, and more.
66

77
The [demo application](https://github.com/Pyratron/Command-Parser/archive/master.zip) contains a short tutorial and a variety of example commands to get you started.
88

9-
Documentation will be created when the final library is released.
9+
##Documentation & Tutorials
10+
Documentation and tutorials are available on the [Pyratron website](https://www.pyratron.com/projects/command-parser).
1011

11-
###Example:
12-
13-
```csharp
14-
Parser = CommandParser.CreateNew().UsePrefix(string.Empty).OnError(OnParseError);
15-
16-
Parser.AddCommand(Command
17-
.Create("Ban User") //Friendly Name.
18-
.AddAlias("ban") //Aliases.
19-
.AddAlias("banuser")
20-
.SetDescription("Bans a user from the server.") //Description.
21-
//Action to be executed when command is ran with correct parameters. (Of course, can be method, lamba, delegate, etc)
22-
.SetAction(OnBanExecuted)
23-
//Precondition to be checked before executing the command.
24-
.SetExecutePredicate(delegate
25-
{
26-
if (banned)
27-
return "You are already banned!";
28-
return string.Empty;
29-
})
30-
.AddArgument(Argument //Add an argument.
31-
.Create("User")));
32-
```
33-
34-
...
35-
36-
```csharp
37-
private static void OnBanExecuted(Argument[] args)
38-
{
39-
var user = args.FromName("user");
40-
Console.WriteLine("User {0} was banned!", user);
41-
banned = true;
42-
}
43-
44-
private static void OnParseError(object sender, string message)
45-
{
46-
Console.ForegroundColor = ConsoleColor.Red;
47-
Console.WriteLine(message);
48-
Console.ForegroundColor = ConsoleColor.Gray;
49-
}
50-
```
51-
52-
...
53-
54-
```csharp
55-
Parser.Parse("ban someone");
56-
```
12+
###Example Application:
13+
[![Example](https://www.pyratron.com/images/pages/command-parser/command-parser.png)]

0 commit comments

Comments
 (0)