#!/usr/bin/env python2.5
-import git, options
+import git, options, client
from helpers import *
optspec = """
-[BUP_DIR=...] bup init
+[BUP_DIR=...] bup init [-r host:path]
+--
+r,remote= remote repository path
"""
o = options.Options('bup init', optspec)
(opt, flags, extra) = o.parse(sys.argv[1:])
log("bup init: no arguments expected\n")
o.usage()
-exit(git.init_repo())
+if opt.remote:
+ git.init_repo() # local repo
+ git.check_repo_or_die()
+ cli = client.Client(opt.remote, create=True)
+ cli.close()
+ exit(0) # if close() didn't throw an exception
+else:
+ exit(git.init_repo())