commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schley Andrew Kutz <>
Subject I've ported CLI to C#, next steps?
Date Thu, 24 Apr 2008 17:48:43 GMT
Hash: SHA1

Hi. I've ported version 1.1 of the CLI library to Microsoft .NET 2.0  
using C#. My reasons are not selfless -- I simply needed a good  
command line argument parsing library for .NET, and I could not find  
one. Instead of reinventing the wheel I decided to port your library  
since I use it whenever developing command line applications in Java.

Here are the notable changes I made while porting:

- - Java's iterator is bi-directional while .NET's enumerator is simple,  
and uni-directional. I created a class, BidirectionalEnumerator<T> to  
match the functionality present in Java.

- - Getters and setters have become property accessors. For example,  
instead of getWidth() and setWidth(), there is now Width { get; set; }.

- - Method names now begin with upper case.

- - Class level variables are now prefixed with "m_".

- - Interfaces now begin with upper case "I". Ex. CommandLineParser is  
now ICommandLineParser.

- - I've used generics where possible instead of Objects. Ex. An  
ArrayList of Object types intended to hold strings is now List<string>.

- - I've used Dictionary<Tk,Tv> for a hash table.

- - In Java, the method substring is defined as func(int begin, int end)  
where end is exclusive and the length to splice is a result of end -  
begin. In .NET Substring is func(int begin, int length) where length  
is inclusive. Instead of changing your math I instead created a static  
class called JavaPorts and have created the method  
JavaPorts.Substring( string value, int beginIndex, int endIndex ) that  
functions as Java's substring.

I generally release my code under the New BSD license, and unless you  
would like to host this port on Apache's site I am going to open a  
SourceForge project for my port, or simply host it on my own site,



(p.s. Thanks for the great library!)

- --
- -a

"condensing fact from the vapor of nuance"

gpg pubkey:
lostcreations ca:

Version: GnuPG v1.4.7 (Darwin)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message