Permalink
Browse files

Add archive command to CLI

  • Loading branch information...
1 parent 1a1a63a commit 4669008b123c14c39dd29328a953832baf6a992c @mwilliamson committed Dec 20, 2012
Showing with 16 additions and 1 deletion.
  1. +16 −1 blah/commands.py
View
@@ -32,7 +32,22 @@ def execute(self, args):
print "fetch failed: {0}".format(error.message)
exit(-1)
+class ArchiveCommand(object):
+ def create_parser(self, subparser):
+ subparser.add_argument("repository_uri", metavar="repository-uri")
+ subparser.add_argument("local_path", metavar="local-path")
+
+ def execute(self, args):
+ try:
+ blah.fetcher.archive(args.repository_uri, args.local_path)
+ except (blah.errors.BlahUserError, blah.util.NoSuchCommandError) as error:
+ print "archive failed: {0}".format(error.message)
+ exit(-1)
+
+
+
commands = {
"what-is-this": what_is_this_command,
- "fetch": FetchCommand()
+ "fetch": FetchCommand(),
+ "archive": ArchiveCommand()
}

0 comments on commit 4669008

Please sign in to comment.