Merge branch 'master' into update-wording-around-gopkgin

This commit is contained in:
Dan Buch 2016-09-11 11:43:05 -04:00 committed by GitHub
commit b425397570
2 changed files with 8 additions and 3 deletions

View File

@ -849,7 +849,7 @@ func main() {
### Generated Help Text ### Generated Help Text
The default help flag (`-h/--help`) is defined as `cli.HelpFlag` and is checked The default help flag (`-h/--help`) is defined as `cli.HelpFlag` and is checked
by the cli internals in order to print generated help text for the app, command, by the cli internals in order to print generated help text for the app, command,
or subcommand, and break execution. or subcommand, and break execution.
@ -954,7 +954,7 @@ is checked by the cli internals in order to print the `App.Version` via
#### Customization #### Customization
The default flag may be cusomized to something other than `-v/--version` by The default flag may be customized to something other than `-v/--version` by
setting `cli.VersionFlag`, e.g.: setting `cli.VersionFlag`, e.g.:
<!-- { <!-- {

View File

@ -79,7 +79,12 @@ func (c *Context) IsSet(name string) bool {
return return
} }
envVarValue := reflect.ValueOf(f).FieldByName("EnvVar") val := reflect.ValueOf(f)
if val.Kind() == reflect.Ptr {
val = val.Elem()
}
envVarValue := val.FieldByName("EnvVar")
if !envVarValue.IsValid() { if !envVarValue.IsValid() {
return return
} }