reduce diff
This commit is contained in:
parent
11777de30c
commit
35510ee0f9
@ -25,11 +25,9 @@ type Context struct {
|
|||||||
// NewContext creates a new context. For use in when invoking an App or Command action.
|
// NewContext creates a new context. For use in when invoking an App or Command action.
|
||||||
func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context {
|
func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context {
|
||||||
c := &Context{App: app, flagSet: set, parentContext: parentCtx}
|
c := &Context{App: app, flagSet: set, parentContext: parentCtx}
|
||||||
|
|
||||||
if parentCtx != nil {
|
if parentCtx != nil {
|
||||||
c.Context = parentCtx.Context
|
c.Context = parentCtx.Context
|
||||||
c.shellComplete = parentCtx.shellComplete
|
c.shellComplete = parentCtx.shellComplete
|
||||||
|
|
||||||
if parentCtx.flagSet == nil {
|
if parentCtx.flagSet == nil {
|
||||||
parentCtx.flagSet = &flag.FlagSet{}
|
parentCtx.flagSet = &flag.FlagSet{}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user