tags:

views:

409

answers:

2

The Mono.GetOptions package has been made obsolete, but doesn't seem to have anything to replace it. The docs point to NDesk.Options, but NDesk's own webpage claims that Options is unstable. Why was GetOptions made obsolete, and what is planned to replace it?

+7  A: 

NDesk.Options is stable--so much so that it is now called Mono.Options as bundled with Mono 2.2 and above. This is the recommended replacement. It is packaged as a single .cs file as opposed to a separate assembly, so it is not as easy to find.

I don't know specifically why Mono.GetOptions was deprecated, but one of the arguments against it was that it was heavyweight; it requires you to define your own class inheriting from its Options class and liberal sprinkling of attributes.

Michael Greene
+5  A: 

Mono.GetOptions is obsolete because its author has disappeared off the face of the earth and no one has stepped up to volunteer for future maintenance. That's the short of it.

NDesk.Options/Mono.Options are "unstable" in that the API is, in fact, unstable -- I reserve the right to change the public API in an incompatible manner if deemed appropriate. (I hope I won't need to, but I reserve that right.) That said, I'm still around, so it is being maintained (or capable of being maintained).

This is why Mono.Options is distributed as source -- if the API changes, it doesn't matter, as you have a copy of the source bundled with your program. (It's also why NDesk.Options.dll isn't signed -- so it won't be placed in the GAC, as assemblies in the GAC have a strong assumption that they won't change API in an incompatible manner.)

jonp