Skip to content

Commit

Permalink
Reformatted README for nicer nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
kcartlidge committed Nov 7, 2020
1 parent c7434d5 commit 1896343
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 7th November 2020 - additional

- Reformatted README
- Nicer layout in Nuget

## 7th November 2020 - v3.0.0

- Cleaner public surface
Expand Down
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var read = parser.GetOption<string>("read");

### Example autogenerated help info (`.Help()`)

Required options come first, then optional options, then flags.
Each of those three blocks is further sorted alphabetically.
- Required options come first, then optional options, then flags
- Each of those three blocks is further sorted alphabetically

``` text
-read <value> Folder to read the site from (required)
Expand All @@ -54,10 +54,7 @@ Errors come in two collections. The property `HasErrors` will be `true` if eithe
- `ExpectationErrors` are where expectations are not met by the arguments provided (eg missing required option)
- `ArgumentErrors` are where something was provided but there were issues with it (eg a value without an option)

For example, with the coniguration above and the example input shown the combined errors will be as below.
The first is an expectation error and is keyed by the name of the option.
The remaining three are argument errors keyed by their 0-based offset into the args provided.
Notice that the "missing" `read` option has no error. This is because it was defined above with a default value.
For example, with the configuration above and the example input shown the combined errors will be as follows.

``` text
write => Option missing: write
Expand All @@ -66,24 +63,32 @@ write => Option missing: write
4 => Unknown flag: ignore
```

- The first is an expectation error and is keyed by the name of the option
- The remaining three are argument errors keyed by their 0-based offset into the args provided
- The "missing" `read` option has no error; it was defined above with a default value

## Supported

- Display help showing supported flags/options
- Required named option/values
- Optional named option/values
- Optional named flags
- Parsing generates simple collections
- A collection of all provided options (keys and their typed values)
- A collection of all provided flags (array of named)
- Provides a collection of error messages
- Missing required options
- Unknown flags or options
- Values not attached to options
- Default option values
- Option types support any `IConvertable`, including `int`, `bool`, `DateTime`
- Accepts either `-` or `--` prefixes
- Provides two collections of error messages
- Expectation errors
- Missing required options
- Argument errors
- Option values of incorrect type
- Unexpected values (not with an option)
- Unnamed flags or options
- Unknown flags or options

## The example in detail

The assertions, which are provided for clarity, are from NUnit.

``` csharp
var args = new string[] { "-run", "data", "Site Title", "--serve", "-ignore", "-port", "3000" };

Expand Down

0 comments on commit 1896343

Please sign in to comment.