Skip to content

Commit 8c40ec8

Browse files
committed
Added check
1 parent 5fe6d74 commit 8c40ec8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

plugins/components/conversionlayer.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,16 +378,21 @@ func getActionFunc(cmd Command) cli.ActionFunc {
378378
}
379379

380380
func ConvertContext(baseContext *cli.Context, flagsToConvert ...Flag) (*Context, error) {
381+
print(baseContext)
381382
pluginContext := &Context{
382383
CommandName: baseContext.Command.Name,
383384
Arguments: baseContext.Args(),
384385
PrintCommandHelp: getPrintCommandHelpFunc(baseContext),
385-
ParentContext: &Context{
386+
}
387+
388+
if baseContext.Parent() != nil {
389+
pluginContext.ParentContext = &Context{
386390
CommandName: baseContext.Parent().Command.Name,
387391
Arguments: baseContext.Parent().Args(),
388392
PrintCommandHelp: getPrintCommandHelpFunc(baseContext.Parent()),
389-
},
393+
}
390394
}
395+
391396
return pluginContext, fillFlagMaps(pluginContext, baseContext, flagsToConvert)
392397
}
393398

0 commit comments

Comments
 (0)