Merge branch 'master' into redundant-nil-check-slice

main
Audrius Butkevicius 5 years ago committed by GitHub
commit 6aa7f352fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@ language: go
sudo: false sudo: false
dist: trusty dist: trusty
osx_image: xcode8.3 osx_image: xcode8.3
go: 1.8.x go: 1.11.x
os: os:
- linux - linux

@ -495,11 +495,12 @@ func (a Author) String() string {
// it's an ActionFunc or a func with the legacy signature for Action, the func // it's an ActionFunc or a func with the legacy signature for Action, the func
// is run! // is run!
func HandleAction(action interface{}, context *Context) (err error) { func HandleAction(action interface{}, context *Context) (err error) {
if a, ok := action.(ActionFunc); ok { switch a := action.(type) {
case ActionFunc:
return a(context) return a(context)
} else if a, ok := action.(func(*Context) error); ok { case func(*Context) error:
return a(context) return a(context)
} else if a, ok := action.(func(*Context)); ok { // deprecated function signature case func(*Context): // deprecated function signature
a(context) a(context)
return nil return nil
} }

@ -57,7 +57,7 @@ type Command struct {
// Boolean to hide this command from help or completion // Boolean to hide this command from help or completion
Hidden bool Hidden bool
// Boolean to enable short-option handling so user can combine several // Boolean to enable short-option handling so user can combine several
// single-character bool arguements into one // single-character bool arguments into one
// i.e. foobar -o -v -> foobar -ov // i.e. foobar -o -v -> foobar -ov
UseShortOptionHandling bool UseShortOptionHandling bool

Loading…
Cancel
Save