commandlineparser / commandlineparser/commandline

Support fake results

Offen
#85 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
C#
Sterne
4.8k
Forks
478
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Issue by [themacguffinman](https://github.com/themacguffinman)**
_Thursday Aug 25, 2016 at 06:58 GMT_
_Originally opened as https://github.com/gsscoder/commandline/issues/345_

----

Right now it's impossible to raise my own parser errors because all classes relating to the error system are `sealed` with `internal` constructors.

This snippet from `HelpTextTests` is completely inaccessible:

```
var fakeResult = new NotParsed(
TypeInfo.Create(typeof(NullInstance)),
new Error[]
{
new BadFormatTokenError("badtoken"),
new MissingValueOptionError(new NameInfo("x", "switch")),
new UnknownOptionError("unknown"),
new MissingRequiredOptionError(new NameInfo("", "missing")),
new SequenceOutOfRangeError(new NameInfo("s", "sequence")),
new NoVerbSelectedError(),
new BadVerbSelectedError("badverb"),
new HelpRequestedError(), // should be ignored
new HelpVerbRequestedError(null, null, false) // should be ignored
});
```

Please publicly expose the error system to support custom error management.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.