The project home page and this documentation can be accessed at http://csharpoptparse.sourceforge.net and the project summary page is located at http://sourceforge.net/projects/csharpoptparse.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.If you find this code useful and you wish to support this project, please go here:
Although there are a few command-line option parsers available for different languages including .NET, many were not flexible and robust. This library ports a large portion of the functionality from the Perl GetOpt library. In addition to this functionality, additional features have been added that integrate with the .NET language better.
The library revolves around the Parser class. This class uses an implementation of an IOptionResults interface to store results of parsing the command-line. The definition of the options can be done in two ways:
Class | Description |
---|---|
OptDefAttribute | Define that a property or field can be given as an option |
LongOptionNameAttribute | Defines a long option for a field or property |
ShortOptionNameAttribute | Defines a short option name for a field or property |
UseNameAsLongOptionAttribute | Gives the ability to stop the name of a field or property being used to be used as an option name |