-
Notifications
You must be signed in to change notification settings - Fork 0
Introduction
The main purpose of vCommands is to provide applications with an easy way to execute textual commands.
If you have an idea of how such console commands generally work, take a look at the test code. It may speak louder to you than any text.
vCommands includes a thoroughly-tested tokenizer and parser. The tokenizer takes a string and enumerates every token inside it, while the parser builds an expression tree from a sequence of tokens.
The code is explained in the Parser page.
The "main" class of the library is vCommands.Host, which accounts for all the commands, variables and manuals and also handles textual executions. Currently, they also store aliases and user commands.
A large portion of my code is centered around Garry's Mod, a Source engine-based game.
The Source engine includes a developer console (accessible through the ~ key) where a user is allowed to execute certain commands, such as status for listing the server status, changelevel to change the current map, maxplayers to set the maximum players on the server, fps_max to change the maximum number of frames per second, etc.
This makes development especially easy, because it can allow (secure) low-level access into a system but also the possibility to configure most things in the software through the use of ConVars, a wrapper around commands to turn them into variables which can be very efficiently accessed in the code.
vCommands employs the same syntax for raw commands (including the "togglers", + and -), but I decided to not "implement" the bugs too. The separator between invocations (;) is also borrowed from Source.
Bash also influenced the syntax. I decided to use square brackets ([ and ]) to wrap compound arguments, which are simply a way to pipe a command's output into another command as argument.
C-like languages (including C# itself) are the inspiration for the conditional structure.
Check out the Syntax page for information about the syntax of commands.
Too much or not enough information?
Just give vCommands a try. Grab the latest release or clone it.
Every single public thing in vCommands is documented. Be sure to grab the .XML file associated with your release or reference the project directly to have the documentation available through IntelliSense.
Please feel free to contribute to the wiki and the code. If you do not want to but still want to make a contribution, please post an issue or contact the author directly.