You may like my Rug.Cmd
Easy to use and extensible command line parser. Handles: Bool, Plus / Minus, String, String List, CSV, Enumeration.
Built in '/?' help mode.
Built in '/ ??' and '/? D '.
static void Main(string[] args) { // create the argument parser ArgumentParser parser = new ArgumentParser("ArgumentExample", "Example of argument parsing"); // create the argument for a string StringArgument StringArg = new StringArgument("String", "Example string argument", "This argument demonstrates string arguments"); // add the argument to the parser parser.Add("/", "String", StringArg); // parse arguemnts parser.Parse(args); // did the parser detect a /? argument if (parser.HelpMode == false) { // was the string argument defined if (StringArg.Defined == true) { // write its value RC.WriteLine("String argument was defined"); RC.WriteLine(StringArg.Value); } } }
Edit: This is my project, and therefore this answer should not be considered as confirmation from a third party. However, I use it for every command line program that I write, it is open source, and I hope others can benefit from it.
Phill Tew Jan 23 '12 at 17:13 2012-01-23 17:13
source share