A good command line parser

  • Thread starter Thread starter puzzlecracker
  • Start date Start date
puzzlecracker said:
Anyone know a simple, yet functional, open source parser that takes
care of command line arguments.


I saw this one
http://69.10.233.10/KB/recipes/command_line.aspx?display=PrintAll


But I need something better, and perhaps more recent, though I cannot
give you specific requirements as I am mocking them up right now.


Thanks


I've always been happy with Environment.GetCommandLineArgs. How, if at all,
is that deficient for your needs?
 
puzzlecracker said:
Anyone know a simple, yet functional, open source parser that takes
care of command line arguments.

I saw this one http://69.10.233.10/KB/recipes/command_line.aspx?display=PrintAll

But I need something better, and perhaps more recent, though I cannot
give you specific requirements as I am mocking them up right now.

There are plenty of getopt ports to C#:

http://www.codeplex.com/getopt
http://sourceforge.net/projects/csharpoptparse/
http://www.phpguru.org/static/getopt.html
http://www.codeproject.com/KB/cs/XGetoptCS.aspx
http://www.codeproject.com/KB/cs/geoptfordotnet.aspx

Arne
 
puzzlecracker said:
Anyone know a simple, yet functional, open source parser that takes
care of command line arguments.


I saw this one
http://69.10.233.10/KB/recipes/command_line.aspx?display=PrintAll


But I need something better, and perhaps more recent, though I cannot
give you specific requirements as I am mocking them up right now.

My first reccomendation would be to write PowerShell cmdlets instead of
console apps. PowerShell will give you a LOT more than just command line
parsing.

But, if you don't want to depend on PowerShell, here are some options:

http://69.10.233.10/KB/recipes/plossum_commandline.aspx

http://www.codeplex.com/commandline

There are others on both CodePlex and CodeProject.
 
Back
Top