Title: Is there a command line argument parsing library that supports parsing java like system argument (-Dproperty=value)?
Tags: c#;command-line-arguments
Question: Basically I would like to specify a number of different argument, and ideally have a Dictionary populated.  Something along the lines of:

``` c:\&gt; MyApp.exe -Dproperty1=value1 -Dproperty2=value2
```

Would translate to something like:

``` Dictionary<string,string&gt;() { { "property1", "value1" }, { "property2", "value2" } } 
```

I have looked at a number of solutions, and none of them seem to support this type of syntax.  Before I create my own, or modify someone else's, I though I would ask.



Here is another answer: You need to write your own parsing algorithm. Anyway, It's not that hard using ```Linq```, for example:

```args.Skip(1) // skip the program name
.Select(x =&gt; { 
                var parts = x.Split('='); 
                return new KeyValuePair<string,string&gt;(
                            parts[0].Replace("-D",""),
                            parts[1]);
             }).ToDictionary(x =&gt; x.Key,x =&gt; x.Value);
```

Comment for this answer: @travis you can add `.Where(x => x.StartsWith("-D"))` before the Select. that will only give you arguments that starts with -D
Comment for this answer: Ya, that would work well if these were the only type of argument that I would need to provide.  The app will have other though, filename, logfilename, whatever.  I was hoping for a solution that allows me to create a few attribute classes, and let something else deal with the parsing, validation and help generation.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:11/06/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><command-line-arguments>', 'Title': 'Is there a command line argument parsing library that supports parsing java like system argument (-Dproperty=value)?', 'ViewCount': 26, 'id': 26775555, 'user_AboutMe': None, 'user_AccountId': 940097.0, 'user_DisplayName': 'travis', 'user_Reputation': 223.0, 'user_Views': 12.0, 'user_id': 968317.0}}