summaryrefslogtreecommitdiffstats
path: root/command.py
diff options
context:
space:
mode:
Diffstat (limited to 'command.py')
-rw-r--r--command.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/command.py b/command.py
index 939a4630..d2129381 100644
--- a/command.py
+++ b/command.py
@@ -16,11 +16,11 @@ import multiprocessing
16import os 16import os
17import optparse 17import optparse
18import re 18import re
19import sys
20 19
21from event_log import EventLog 20from event_log import EventLog
22from error import NoSuchProjectError 21from error import NoSuchProjectError
23from error import InvalidProjectGroupsError 22from error import InvalidProjectGroupsError
23from error import RepoExitError
24import progress 24import progress
25 25
26 26
@@ -42,6 +42,10 @@ WORKER_BATCH_SIZE = 32
42DEFAULT_LOCAL_JOBS = min(os.cpu_count(), 8) 42DEFAULT_LOCAL_JOBS = min(os.cpu_count(), 8)
43 43
44 44
45class UsageError(RepoExitError):
46 """Exception thrown with invalid command usage."""
47
48
45class Command(object): 49class Command(object):
46 """Base class for any command line action in repo.""" 50 """Base class for any command line action in repo."""
47 51
@@ -215,7 +219,7 @@ class Command(object):
215 def Usage(self): 219 def Usage(self):
216 """Display usage and terminate.""" 220 """Display usage and terminate."""
217 self.OptionParser.print_usage() 221 self.OptionParser.print_usage()
218 sys.exit(1) 222 raise UsageError()
219 223
220 def CommonValidateOptions(self, opt, args): 224 def CommonValidateOptions(self, opt, args):
221 """Validate common options.""" 225 """Validate common options."""