Skip to content
gsscoder edited this page Feb 28, 2013 · 10 revisions

If you're not familiar with *nix command line environment, you should know that this library was inspired by C function getopt.

You may want read also this Wikipedia article.

These conventions allow two kind of arguments, options and values:

  • values can be or not be bound to options.
  • options can be defined with short name, long name or both.

Short Name

A short name is defined with a single character (in .NET context a System.Char) and is invoked using single dash or hyphen:

$ coolapp -f somevalue

But this is not the only valid syntax. When a short name is mapped to a System.Boolean, you have just invoke or omit it.

$ coolapp -v

With the previous example I say to coolapp to activate the option named v. To deactivate it, I simply omit its invocation from the command line:

$ coolapp