diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-02-08 09:48:45 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-02-08 09:48:45 +0000 |
commit | aa94f7f0f5ce0b47e5215216d32fa530b43512f8 (patch) | |
tree | 8d68a9dadf418860cf733bb940f65aea4d31de66 /obnamlib/plugins/restore_plugin.py | |
parent | 3c8f442f2a7c7d0f09b9071e68d8420a655dc7b3 (diff) | |
download | obnam-aa94f7f0f5ce0b47e5215216d32fa530b43512f8.tar.gz |
Change the ls subcommand to take list of files
Baseo on patch by Damien Couroussé, but with changes
to make it apply to the current version of Obnam, and
to make the test suite pass.
Diffstat (limited to 'obnamlib/plugins/restore_plugin.py')
-rw-r--r-- | obnamlib/plugins/restore_plugin.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/obnamlib/plugins/restore_plugin.py b/obnamlib/plugins/restore_plugin.py index 29bef635..e5f4c430 100644 --- a/obnamlib/plugins/restore_plugin.py +++ b/obnamlib/plugins/restore_plugin.py @@ -65,9 +65,9 @@ class RestorePlugin(obnamlib.ObnamPlugin): self.app.add_subcommand('restore', self.restore, arg_synopsis='[DIRECTORY]...') self.app.settings.string(['to'], 'where to restore') - self.app.settings.string(['generation'], + self.app.settings.string_list(['generation'], 'which generation to restore', - default='latest') + default=['latest']) @property def write_ok(self): @@ -118,7 +118,12 @@ class RestorePlugin(obnamlib.ObnamPlugin): self.errors = False - gen = self.repo.genspec(self.app.settings['generation']) + generations = self.app.settings['generation'] + if len(generations) != 1: + raise obnamlib.Error( + 'The restore command wants exactly one generation option') + + gen = self.repo.genspec(generations[0]) self.configure_ttystatus() self.app.ts['total'] = self.repo.client.get_generation_file_count(gen) |