From 15e6b2fcc755130371d60193cc6d04b50ef9d546 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Fri, 19 Jun 2015 17:06:04 -0400 Subject: [PATCH] Add func to get context parent Signed-off-by: Brian Goff --- context.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/context.go b/context.go index 5b67129..c75607e 100644 --- a/context.go +++ b/context.go @@ -180,6 +180,11 @@ func (c *Context) GlobalFlagNames() (names []string) { return } +// Returns the parent context, if any +func (c *Context) Parent() *Context { + return c.parentContext +} + type Args []string // Returns the command line arguments associated with the context.