Permalink
Browse files

cli interface

  • Loading branch information...
kennethreitz committed Nov 26, 2011
1 parent e6e62e2 commit 9c1996bffa3dfe526ac371ffe3231ba6c367645a
Showing with 32 additions and 1 deletion.
  1. +32 −1 dirsnap/cli.py
View
@@ -9,6 +9,37 @@
import sys
+from clint import args
+
+from .archive import archive
+from .gist import upload
+
+
+
+def display_usage():
+ """Obvious, no?"""
+ print 'Usage: dirsnap <dir>'
+
+
def main():
- print '\o/'
+ """Dirsnap entrypoint."""
+
+ paths = args.files
+
+ if not paths:
+ display_usage()
+ sys.exit(1)
+
+ # Create temp archive.
+ print >> sys.stderr, 'Creating snapshot...'
+ path = archive(paths)
+
+ # Upload temp archive to service.
+ print >> sys.stderr, 'Uploading snapshot...'
+ url = upload(path)
+ print >> sys.stderr, 'Done! Here it is:'
+
+ print url
+
+
sys.exit()

0 comments on commit 9c1996b

Please sign in to comment.