[jhbuild] display a different error message when the command matches a module name



commit e0ca9ffa253ad5ae26848b539af47d1a963db6d5
Author: FrÃdÃric PÃters <fpeters 0d be>
Date:   Sat Oct 8 15:42:54 2011 -0400

    display a different error message when the command matches a module name

 jhbuild/commands/__init__.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/commands/__init__.py b/jhbuild/commands/__init__.py
index 4554612..6b84367 100644
--- a/jhbuild/commands/__init__.py
+++ b/jhbuild/commands/__init__.py
@@ -115,7 +115,12 @@ def run(command, config, args, help):
         except ImportError:
             pass
     if command not in _commands:
-        raise FatalError(_('no such command (did you mean "jhbuild run %s"?)' % command))
+        import jhbuild.moduleset
+        module_set = jhbuild.moduleset.load(config)
+        if module_set.get_module(command):
+            raise FatalError(_('no such command (did you mean "jhbuild build %s"?)' % command))
+        else:
+            raise FatalError(_('no such command (did you mean "jhbuild run %s"?)' % command))
 
     command_class = _commands[command]
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]