Add path, existingfile and existingdir types.

- Document custom types.
- Add docker example.
This commit is contained in:
Alec Thomas
2018-06-21 16:16:27 +10:00
parent cdcdf49f67
commit 212ea2a356
11 changed files with 440 additions and 121 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ func buildChild(k *Kong, node *Node, typ NodeType, v reflect.Value, ft reflect.S
}
func buildField(k *Kong, node *Node, v reflect.Value, ft reflect.StructField, fv reflect.Value, tag *Tag, name string, seenFlags map[string]bool) {
mapper := k.registry.ForNamedType(tag.Type, fv)
mapper := k.registry.ForNamedValue(tag.Type, fv)
if mapper == nil {
fail("unsupported field type %s.%s (of type %s)", v.Type(), ft.Name, ft.Type)
}