Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Commits on Apr 18, 2009
  1. @jonpryor

    Fix OutOfMemoryException caused by description text.

    jonpryor authored
    	* src/NDesk.Options/NDesk.Options/Options.cs: Viktor Lundgren reported
    	  that Option.Description text of `"aaa." . "a" x 64` (that is, "aaa."
    	  followed by 64 "a"s) would cause GetLines() to go into an infinite
    	  loop and (eventually) die from an OutOfMemoryException.  Oops.
    	  Fix this, simplify the logic, and turn GetLines() into an
    	* src/NDesk.Options/Test/NDesk.Options/OptionSetTest.cs: Add tests for
    	  line breaking.
  2. @jonpryor

    Generate Microsoft XML Documentation Comments.

    jonpryor authored
    Visual Studio looks for a .xml file alongside the .dll to display comments
    during code editing, so oblige it...
Commits on Oct 23, 2008
  1. @jonpryor

    Cleanup the error message with nullable types when invalid values are…

    jonpryor authored
    … used.
    "Could not convert string `' to type Nullable`1..." is not nearly as helpful as
    "Could not convert string `' to type Int32...".
    	* src/NDesk.Options/NDesk.Options/Options.cs: Use the underlying
    	  target type in the error message.
    	* src/NDesk.Options/Test/NDesk.Options/OptionSetTest.cs: Add a test
    	  for the underlying target type within the exception message.
  2. @jonpryor
  3. @jonpryor

    Add support for nullable types to OptionSet.Add().

    jonpryor authored
    This allows straightforward use of nullable types, e.g.
    		int verbosity = 0;
    		new OptionSet () {
    			{ "v:", (int? v) => verbosity = v.HasValue
    				? v.Value : verbosity + 1 },
    		}.Parse (new[]{"-v"); // verbosity == 1
    	* Specify NDESK_OPTIONS on the compile lines.
    	* doc/en/NDesk.Options/OptionSet.xml: Document nullable type support.
    	* lib/pkgconfig/ Add -d:NDESK_OPTIONS so that
    	  packages using prior versions of NDesk.Options don't see a
    	  gratuitous namespace change.
    	* src/NDesk.Options/NDesk.Options/Options.cs: Option.Parse<T>() now
    	  special-cases nullable type conversion.
    	* src/NDesk.Options/NDesk.Options/Options.cs,
    	  src/NDesk.Options/Test/NDesk.Options/Utils.cs: Namespace
    	  "harmonization" with Mono.Options, so that we can use identical
    	  source in each place, thus minimizing the maintenance burden.
Commits on Oct 13, 2008
  1. @jonpryor

    Fixup target invocations.

    jonpryor authored
    	* Call doc-html, not html, due to the prior
    	  doc/Makefile.include target renaming...
  2. @jonpryor


    jonpryor authored
    	* Remove AC_CANONICAL_SYSTEM, as we're generating
    	  platform-independent IL, and thus don't need to care about the build
  3. @jonpryor


    jonpryor authored
    	* doc/Makefile.include: Remove $(DOC_EXAMPLES_OUTPUT) from
    	  $(DOC_CLEANFILES), as these files are stored in git and thus
    	  shouldn't be removed as part of the build process.  (The sample
    	  output is in git as a secondary set of "unit tests", ensuring that
    	  no unexpected changes occur.)
  4. @jonpryor

    Prefix documentation targets with `doc-`.

    jonpryor authored
    	doc/Makefile.include: Prefix documentation targets with `doc-`.
Commits on Sep 16, 2008
  1. @jonpryor

    Fix .NET Compatibility.

    jonpryor authored
    Apparently .NET's KeyedCollection<TKey,TValue>.Dictionary is originally null,
    and isn't allocated until .SetItem() or .InsertItem() is invoked...meaning we
    need to ensure that one of these methods is invoked before we use Dictionary.
    	* src/NDesk.Options/NDesk.Options/Options.cs: Ensure that InsertItem()
    	  or SetItem() are called before accessing the Dictionary property.
    	  GetKeyForItem() needs a null check (to fix an OptionSetTest for
    	  `v.Add(null)`, which would otherwise NRE).
  2. @jonpryor

    Correct "exception-safe" insertion.

    jonpryor authored
    	* src/NDesk.Options/NDesk.Options/Options.cs: Properly keep track of
    	  the names that were added to the Dictionary, so that if an insertion
    	  fails we can properly "roll back" to the previous state.
Commits on Aug 16, 2008
  1. @jonpryor

    Remove several Gendarme warnings within NDesk.Options.dll

    jonpryor authored
    	* src/NDesk.Options/NDesk.Options/Options.cs: Remove warnings about
    	  non-static but can be static methods, OptionException missing a
    	  default constructor, a missing LinkDemand in
    	  OptionException.GetObjectData(), internal classes which can be
    	  sealed, string optimizations, etc.
Commits on Jun 2, 2008
  1. @jonpryor

    Fix a build break for alp.

    jonpryor authored
    	* Apparently $(builddir) can be unset, which breaks the
    	  build as /src/NDesk.Options/AssemblyInfo.cs can't be found.
Commits on May 27, 2008
  1. @jonpryor

    Fix `make html` target.

    jonpryor authored
    	* doc/.gitignore: Ignore the generated doc/ndesk-options directory.
    	* doc/Makefile.include: Fix the `html` target (broken by the previous
    	  "fix `make clean; make distcheck`" commit).
Commits on May 26, 2008
  1. @jonpryor

    Fix `make distcheck`.

    jonpryor authored
    	* Don't generate `doc/Makefile` anymore.
    	* `SUBDIRS=doc` caused `make clean; make distcheck` to fail, as
    	  `doc' would be built before `.' which fails as doc requires
    	  NDesk.Options.dll, built by `.'.  The documented solution of
    	  `SUBDIRS=. doc` didn't work, so just remove the recursive make nonsense
    	  and place everything relevant into the top-level Makefile.
    	* doc/ Rename to doc/Makefile.include.
    	* doc/Makefile.include: Rename symbols for namespace scoping, as this file
    	  will be `include`d from top-level
    	* doc/en/examples/, doc/en/examples/,
    	  doc/en/examples/, doc/en/examples/,
    	  doc/en/examples/ Change the program path, as they'll be
    	  executed from topdir, not from topdir/doc.
Commits on May 16, 2008
  1. @jonpryor

    Flush the documentation.

    jonpryor authored
    	* doc/en/index.xml: Minor monodoc-2.0 format change.
    	* doc/en/NDesk.Options/Option.xml,
    	  doc/en/NDesk.Options/OptionSet.xml: monodoc-2.0 format
    	  changes (addition of <TypeParameters/> and changes to
    	  <TypeParameter/>); improve the docs.
Commits on Apr 7, 2008
  1. @jonpryor

    Cleanup documentation; better C# 2.0 support.

    jonpryor authored
    	* src/NDesk.Options/NDesk.Options/Options.cs: Update comments to reflect
    	  current implementation (w/o repeating all the actual docs); fix some
    	  C# 3-isms that were left in the code (not sure why -langversion:ISO-2
    	  didn't catch these).
Commits on Mar 31, 2008
  1. @jonpryor

    Migrate the unit tests to use NUnit; place into separte files.

    jonpryor authored
    	* Don't build bin/options-test*.exe, instead build
    	  lib/ndesk-options/NDesk.Options_test(_linq?).dll, which contains NUnit
    	  tests for NDesk.Options.dll.  Change the `check' target to use
    	  nunit-console2 to run the unit tests.
    	* src/NDesk.Options/NDesk.Options/Options.cs: Move unit tests under
    	* src/NDesk.Options/Test/NDesk.Options/OptionContextTest.cs,
    	  src/NDesk.Options/Test/NDesk.Options/Utils.cs: Added; unit tests for
    	  NDesk.Options (originally from Options.cs).
Commits on Mar 30, 2008
  1. @jonpryor

    Force C# 2.0 support within NDesk.Options.dll.

    jonpryor authored
    	* Ensure that NDesk.Options.dll can be built under a C# 2.0
    	  compiler by specifying -langversion:ISO-2.
Commits on Mar 11, 2008
  1. @jonpryor

    Use KeyedCollection<string, Option> as the OptionSet base class.

    jonpryor authored
    	* Bump the package version to 0.2.1.
    	* doc/en/NDesk.Options/Option.xml, doc/en/NDesk.Options/OptionAction`2.xml,
    	  doc/en/NDesk.Options/OptionValueType.xml: Flush new <AssemblyVersion/>.
    	* doc/en/NDesk.Options/OptionSet.xml: Flush; add new members; remove old
    	  members; flush <AssemblyVersion/>s; etc.
    	* doc/en/index.xml: Version bump.
    	* doc/en/examples/subclass.cs: Use non-obsolete methods.
    	* src/NDesk.Options/NDesk.Options/Options.cs: Use
    	  KeyedCollection<string,Option> instead of Collection<Option> as the
    	  OptionSet base class, as KeyedCollection is closer semantically to what
    	  OptionSet does.  Remove unnecessary overloads, members.  Obsolete
    	  public/protected members that we shouldn't remove yet.
Commits on Mar 8, 2008
  1. @jonpryor

    Document the default handler, WriteOptionDescriptions() changes.

    jonpryor authored
    	* doc/en/NDesk.Options/Option.xml, doc/en/NDesk.Options/OptionSet.xml:
    	  Flush updated docs.
    	* doc/en/examples/bundling.cs: Add an example of a default handler.
    	* doc/en/examples/ Test the default handler.
    	* doc/en/examples/bundling.txt: Flush.
    	* doc/en/examples/greet.cs: Update to make use of WriteOptionDescriptions()
    	  value formatting feature.
    	* doc/en/examples/greet.txt: Flush.
Commits on Mar 3, 2008
  1. @jonpryor

    Fix Option prototype checking.

    jonpryor authored
    	* src/NDesk.Options/NDesk.Options/Options.cs: The previous checks for '<>'
    	  handlers was wrong, as it flagged "a|b=" (requiring 2 values) as a '<>'
    	  handler, generating an exception (which is wrong).
Commits on Feb 27, 2008
  1. @jonpryor

    Permit C# 2.0 compatibility.

    jonpryor authored
    	* Add CSFLAGS, so that we can test C# 2.0 compatibility in the
    	  future with `make CSFLAGS=-langversion:ISO-2`.
    	* src/NDesk.Options/NDesk.Options/Options.cs: Allow non-TEST code to be
    	  compiled with a C# 2.0 compile (no lambdas, no var, no auto-properties...).
Commits on Feb 26, 2008
  1. @jonpryor

    Add "default" argument handling support.

    jonpryor authored
    	* src/NDesk.Options/NDesk.Options/Options.cs: Add "default" argument
    	  handling support.  Normally, all unhandled arguments are returned from
    	  OptionSet.Parse().  However, if an Option with the name "<>" is
    	  registered, then that Option will be invoked to handle unhandled arguments
    	  (and thus OptionSet.Parse() will always return an empty list).
    	  This is useful to handle "argument runs", where some arguments are
    	  influenced by a preceeding Option, e.g.
    	  `mdoc assemble --format=ecma dirA dirB --format=error dirC dirD`
Commits on Feb 24, 2008
  1. @jonpryor

    Improve HTML-generated docs.

    jonpryor authored
    	* doc/.gitignore: Ignore doc-def-template.xsl.
    	* doc/doc-template.html: Rename to doc-template.xsl.
    	* doc-template.xsl: Simplification; use named templates from
    	* doc-def-template.xsl so that less code needs to be duplicated.  Add a
    	  <script/> block for prettyprint.js.
    	* doc/ Use `mdoc export-html` (depends on svn-version of
    	  monodoc), and extract the default template into doc-def-template.xsl.
    	  This allows us to re-use the named templates within this file, simplifying
    	* doc/prettyprint.js: Added; JavaScript file that provides syntax color
    	  highlighting for <pre/> blocks; from Monologue.
Commits on Feb 21, 2008
  1. @jonpryor

    The pkgconfig file should provide a Libs: section.

    jonpryor authored
    	* lib/pkgconfig/ Properly follow
    	  and provide a Libs: section so `pkg-config --libs` has useful output.
Commits on Feb 20, 2008
  1. @jonpryor

    Add Option.Description auto-wrapping to OptionSet.WriteOptionDescript…

    jonpryor authored
    	* src/NDesk.Options/NDesk.Options/Options.cs: Auto-wrap the descriptive text
    	  so that it looks nice on an 80-column wide display (i.e. descriptions
    	  shouldn't enter column 1).
Commits on Feb 19, 2008
  1. @jonpryor

    Add name substitution support to OptionSet.WriteOptionDescriptions().

    jonpryor authored
    	* src/NDesk.Options/NDesk.Options/Options.cs: Add name substitution support.
    	  This allows the description string to contain alternate value strings to
    	  use within the option description; for example, by default the key/value
    	  Option "D=" would generate "-D=VALUE1:VALUE2 docs..."; if we provide a
    	  description of "foo {0:key}/{1:value}", then we would instead generate
    	  "-D=key:value".  If the Option takes only 1 argument, you can drop the
    	  numeric prefix and just use "{name}".
Commits on Feb 14, 2008
  1. @jonpryor

    Use a version-less directory for the file.

    jonpryor authored
    	* doc/ Use a version-less directory for the file.
    	  This simplifies deployment to
  2. @jonpryor

    Fix `make distcheck`.

    jonpryor authored
    	* Don't generate lib/pkgconfig/ndesk-options-linq.pc.
  3. @jonpryor

    Ignore generated .mdb files.

    jonpryor authored
    	* doc/en/examples/.gitignore: Ignore *.mdb files.
  4. @jonpryor

    Add documentation for new types.

    jonpryor authored
    	* doc/en/NDesk.Options/OptionAction`2.xml,
    	  doc/en/NDesk.Options/OptionValueCollection.xml: Added.
  5. @jonpryor

    Remove .NET 3.5 pseudo-requirement/support.

    jonpryor authored
    The .NET 3.5 support really complicated the version numbering scheme; it's
    easier to just remove the use of System.Action`2 and use a custom delegate
    type instead.  (Using the major version number for framework version means
    that the NDesk.Options major number is the assembly minor number, and by
    convention if only the assembly minor number changes the changes are intended
    to be backward compatible, which I do NOT want to gaurantee if the
    NDesk.Options major number changes, etc.  Plus, lupus called it stupid.)
    	* Only create lib/ndesk-options/NDesk.Options.dll.
    	* README: Remove information about LINQ build & .NET 3.5 info.
    	* doc/ Use the right NDesk.Options.dll; Add
    	  NDesk.Options.OptionAction`2.xml; Remove System.* types.
    	* doc/en/examples/subclass.cs: Option.ValueCount -> Option.MaxValueCount.
    	* doc/en/NDesk.Options/Option.xml, doc/en/NDesk.Options/OptionContext.xml,
    	  doc/en/NDesk.Options/OptionValueType.xml, doc/en/index.xml: Flush;
    	  fix version numbers, fix <see cref="..." /> links, etc.
    	* doc/en/System/Action`2.xml, doc/en/ns-System.xml: Remove.
    	* lib/pkgconfig/.gitignore: Remove no-longer-generated files.
    	* lib/pkgconfig/ Update.
    	* lib/pkgconfig/ Remove.
    	* src/NDesk.Options/ Simplify the assembly version number
    	  to "@VERSION@.0".  It will now always be tied to the package version.
    	* src/NDesk.Options/NDesk.Options/Options.cs: Remove System.Action`2 when
    	  LINQ isn't defined; add NDesk.Options.OptionAction`2 as replacement;
    	  rename Option.ValueCount to Option.MaxValueCount.
  6. Typo fix

    Alp Toker authored
Commits on Feb 13, 2008
  1. @jonpryor

    Documentation flush.

    jonpryor authored
    	* doc/ Add OptionValueCollection.xml.
    	* doc/doc-template.html: CSS changes for HTML documentation.
    	* doc/en/NDesk.Options/Option.xml, doc/en/NDesk.Options/OptionContext.xml,
    	  doc/en/NDesk.Options/OptionValueType.xml, doc/en/System/Action`2.xml,
    	  doc/en/index.xml: Flush documentation updates.
    	* doc/en/examples/.gitignore: Ignore generated files.
    	* doc/en/examples/bundling.cs, doc/en/examples/,
    	  doc/en/examples/bundling.txt: Add new example program.
Something went wrong with that request. Please try again.