Zend Certified Engineer

phpguru.org

Free PHP, Javascript and C# code

C# Getopt class

A class for easy handling of command line options and arguments. Can handle long and short styles both with or without arguments (--foo, --foo=bar, -f, /f, -f bar, -fbar), and consolidated short options (-fde)

Style Example
Long --foo
Long with (optional) argument --foo=bar
Short -f /f
Short with argument -f bar -fbar
Multiple short options consolidated -fos

 

Installation

Don't quote me on this! Extract the zip to a directory, your projects exiting directory would be a good idea. Keep the .xml file with the dll if you want IntelliSense documentation. Then in Visual Studio, right click References and click Add Reference. Browse to the dll and hit OK. Job done! If you're not using Visual Studio, then afaik, you'll need to specify something like /reference:Heyes.GetOpt.dll when you compile your program (same goes for if you're using Mono).

Documentation

Download

Link to me

If you use any of the code on this site (and if you don't I guess) or it makes your life easier, I'd appreciate a link - http://www.phpguru.org. Thanks.

Last modified: 16:32 29th December 2006