Rants, rambles, news and notes from another geek

Command Line Parser Using XmlSerializer

This is an interesting approach. I’ve been using XmlSerializer for a number of interesting things lately, but this one is very interesting. Here Jamie parses the command string using regex, then uses XmlWriter to create the XML infoset. Then using XmlSerializer, he can populate a custom class that exposes a nice, easy-to use interface. Very cool.

And, of course, as Jamie suggests, this could also work for parsing URLs and query strings.