summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nbblib/commands.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/nbblib/commands.py b/src/nbblib/commands.py
index 1b50dc3..0b0df31 100644
--- a/src/nbblib/commands.py
+++ b/src/nbblib/commands.py
@@ -331,6 +331,13 @@ class ConfigCommand(SourceClassCommand):
# Commands
########################################################################
+class UnknownCommand(Exception):
+ def __init__(self, cmd):
+ super(UnknownCommand, self).__init__()
+ self.cmd = cmd
+ def __str__(self):
+ return "Fatal: Unknown command '%(cmd)s'" % self.__dict__
+
class NBB_Command(object):
def __init__(self, cmd, cmdargs, context):
if Command.plugins.has_key(cmd):
@@ -342,8 +349,8 @@ class NBB_Command(object):
sys.exit(2)
except progutils.ProgramRunError, e:
print "%(prog)s: Fatal:" % context, e
- print "Program aborted."
+ sys.exit(3)
else:
- print "Fatal: Unknown command '%s'" % cmd
- raise NotImplementedError()
+ print "%(prog)s:" % context, UnknownCommand(cmd)
+ sys.exit(2)