0

Possible Duplicate:
Best way to parse command line arguments in C#?

What's the best practice for handling command line arguments?

That is, I want my console application (VC#2008) to be able to handle arguments on command line just like most of the other command line tools do:

> mytool.exe -LongArgument Value -sa value --abcdef

Where the arguments are LongArgument: Value, sa is an abbr. of ShortArgument with value and abcdef are switch-arguments that are just activated when given.

How can I code this in a way that is easily extensible when new arguments come along?

Community
  • 1
  • 1
F.P
  • 17,421
  • 34
  • 123
  • 189

1 Answers1

0

Please use the .net port of the apache commons cli API. This works great.

http://sourceforge.net/projects/dotnetcli/

and the original API for concepts and introduction

http://commons.apache.org/cli/

Andreas
  • 707
  • 1
  • 6
  • 23
  • How does this differ from the one http://stackoverflow.com/questions/491595/best-way-to-parse-command-line-arguments-in-c this one? It also seems quite advanced. – F.P Jun 28 '11 at 09:27
  • Please stop pasting the exact same answer on multiple questions, even when the answer pertains. – Tim Post Jun 28 '11 at 12:40