diff options
author | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-05-10 14:58:18 -0400 |
---|---|---|
committer | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-05-10 14:58:18 -0400 |
commit | 921708980b2e7309f5c92831b467768370158714 (patch) | |
tree | 7279bc1557a48eb0bf5800c26b22c3af1235f2d7 /cliff/app.py | |
parent | dfe456fa6b6eadda8ba77fc74ad043e2b3f9d050 (diff) | |
download | cliff-921708980b2e7309f5c92831b467768370158714.tar.gz |
pass more details to initialize_app so subclasses can decide what sort of initialization to do
Diffstat (limited to 'cliff/app.py')
-rw-r--r-- | cliff/app.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cliff/app.py b/cliff/app.py index eec2d5c..cd2386c 100644 --- a/cliff/app.py +++ b/cliff/app.py @@ -137,7 +137,7 @@ class App(object): """ self.options, remainder = self.parser.parse_known_args(argv) self.configure_logging() - self.initialize_app() + self.initialize_app(remainder) result = 1 if not remainder: result = self.interact() @@ -147,10 +147,13 @@ class App(object): # FIXME(dhellmann): Consider moving these command handling methods # to a separate class. - def initialize_app(self): + def initialize_app(self, argv): """Hook for subclasses to take global initialization action after the arguments are parsed but before a command is run. Invoked only once, even in interactive mode. + + :param argv: List of arguments, including the subcommand to run. + Empty for interactive mode. """ return |