Skip to content

Commit

Permalink
Add a root_app property to cli.Application. Closes #140
Browse files Browse the repository at this point in the history
This adds a property to `cli.Applicatino callled root_app which returns a
reference to the "root" Application object in a tree of Application objects.

Conflicts:
	plumbum/cli/application.py
  • Loading branch information
khorn authored and tomerfiliba committed Oct 15, 2014
1 parent 9d5a4d5 commit 0f82630
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plumbum/cli/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ def __init__(self, executable):
self._switches_by_name[name] = swinfo
self._switches_by_func[swinfo.func] = swinfo

@property
def root_app(self):
return self.parent.root_app if self.parent else self

@classmethod
def unbind_switches(cls, *switch_names):
Expand Down

0 comments on commit 0f82630

Please sign in to comment.