Rename Value.Value to Value.Target to correctly reflect its purpose.

This commit is contained in:
Alec Thomas
2018-06-13 21:12:56 +10:00
parent 29fe92f286
commit c7dca86dad
6 changed files with 23 additions and 16 deletions
+3 -3
View File
@@ -90,7 +90,7 @@ func (k *Kong) extraFlags() []*Flag {
Value: &Value{
Name: "help",
Help: "Show context-sensitive help.",
Value: value,
Target: value,
Tag: &Tag{},
Mapper: k.registry.ForValue(value),
},
@@ -152,9 +152,9 @@ func (k *Kong) applyHooks(ctx *Context) error {
case trace.Command != nil:
key = trace.Command.Target
case trace.Positional != nil:
key = trace.Positional.Value
key = trace.Positional.Target
case trace.Flag != nil:
key = trace.Flag.Value.Value
key = trace.Flag.Value.Target
default:
panic("unsupported Path")
}