Posted By: Sven Groot | Sep 6th @ 2:04 AM
page 1 of 1
Comments: 5 | Views: 722
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

I recently needed to do parse command line arguments for a whole host of different scenarios. Rather than do each individually, I've created generalized command line argument parser. Since I figured others might find that useful too, I've now made it public.

 

Simply create a class, and the constructor parameters and properties marked with a special attribute will define the arguments your application takes. It can even generate usage text and format it for display on the console.

 

In case anyone's interested, you can get the class library, documentation, samples and source code on my site.

exoteric
exoteric
I : Next<I>

Downloading...

Bass
Bass
www.s​preadfirefox.c​om/5years/

You have some competition:

 

http://tirania.org/blog/archive/2008/Oct-14.html

 

Your apporach is different, but also very good. Smiley

 

Seriously I think you write better .NET code then most people @ Microsoft.

PerfectPhase
PerfectPhase
"This is not war, this is pest control!" - Dalek to Cyberman

Sounds a like how powershell cmdlets works.  Wish you could just xcopy and run cmdlets the same way you can console apps.

staceyw
staceyw
Before C# there was darkness...

"Sounds a like how powershell cmdlets works."

 

I liked the way powershell (MSH back then) parsed cmd lines so much, I also created one for c# back in 2005 and posted it to the sandbox.  Also includes powershell style help. 

http://channel9.msdn.com/playground/Sandbox/52952/

page 1 of 1
Comments: 5 | Views: 722
Microsoft Communities