summaryrefslogtreecommitdiff
path: root/seivot
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-04-19 20:06:41 +0100
committerLars Wirzenius <liw@liw.fi>2011-04-19 20:06:41 +0100
commit15206e5ecd6be7f3336e27058b21608366af2c17 (patch)
tree8eacf0ed15b339d2ae271f8be58f1985e9efbe13 /seivot
parentff8c078b8a67c0072a51e96767219f01c657ece6 (diff)
downloadseivot-15206e5ecd6be7f3336e27058b21608366af2c17.tar.gz
Make --program get its choices from the factory.
Diffstat (limited to 'seivot')
-rwxr-xr-xseivot7
1 files changed, 6 insertions, 1 deletions
diff --git a/seivot b/seivot
index 5288443..a8b3613 100755
--- a/seivot
+++ b/seivot
@@ -118,6 +118,9 @@ class Obnam(BackupProgram):
class BackupProgramFactory(object):
programs = [Obnam]
+
+ def names(self):
+ return [p.name for p in self.programs]
def new(self, name, **kwargs):
for p in self.programs:
@@ -128,7 +131,9 @@ class BackupProgramFactory(object):
class Seivot(cliapp.Application):
def add_settings(self):
- self.settings.add_choice_setting(['program'], ['obnam'],
+ self.factory = BackupProgramFactory()
+
+ self.settings.add_choice_setting(['program'], self.factory.names(),
'program to benchmark (%default)')
self.settings.add_integer_setting(['generations'],