diff options
author | Christophe CHAUVET <christophe.chauvet@gmail.com> | 2013-08-27 19:31:41 +0200 |
---|---|---|
committer | Christophe CHAUVET <christophe.chauvet@gmail.com> | 2013-08-27 19:31:41 +0200 |
commit | cdffe7e60294e7c6ff1d0505d654a6b6d61b68c6 (patch) | |
tree | 1c1b2b376c72554df8a4b1c0fb55b99270142378 | |
parent | 76408ceca1421d7d6e4b19b2b1341192128edd40 (diff) | |
download | cliff-cdffe7e60294e7c6ff1d0505d654a6b6d61b68c6.tar.gz |
Display better error message on unknown command, and return code 1
-rw-r--r-- | cliff/app.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cliff/app.py b/cliff/app.py index 5cbd195..2e65b6f 100644 --- a/cliff/app.py +++ b/cliff/app.py @@ -257,7 +257,11 @@ class App(object): return 0 def run_subcommand(self, argv): - subcommand = self.command_manager.find_command(argv) + try: + subcommand = self.command_manager.find_command(argv) + except ValueError as err: + LOG.error(err) + return 1 cmd_factory, cmd_name, sub_argv = subcommand cmd = cmd_factory(self, self.options) err = None |