Enum fields must be required or have a default.

This is a breaking change, but the previous behaviour was broken so I'm
not concerned.

Also made most programmer errors more useful by giving type.field
context information.

Fixes #179.
This commit is contained in:
Alec Thomas
2021-06-21 20:32:40 +09:30
parent c494f8b8f3
commit 247574041d
7 changed files with 33 additions and 23 deletions
+1 -1
View File
@@ -198,5 +198,5 @@ func TestInvalidRuneErrors(t *testing.T) {
Flag bool `short:"invalid"`
}{}
_, err := kong.New(&cli)
require.EqualError(t, err, "invalid short flag name \"invalid\": invalid rune")
require.EqualError(t, err, "<anonymous struct>.Flag: invalid short flag name \"invalid\": invalid rune")
}