]> arthur.barton.de Git - bup.git/blob - cmd/init-cmd.py
Revert (most of) "--remote parameter requires a colon"
[bup.git] / cmd / init-cmd.py
1 #!/usr/bin/env python
2 from bup import git, options, client
3 from bup.helpers import *
4
5 optspec = """
6 [BUP_DIR=...] bup init [-r host:path]
7 --
8 r,remote=  remote repository path
9 """
10 o = options.Options('bup init', optspec)
11 (opt, flags, extra) = o.parse(sys.argv[1:])
12
13 if extra:
14     o.fatal("no arguments expected")
15
16
17 if opt.remote:
18     git.init_repo()  # local repo
19     git.check_repo_or_die()
20     cli = client.Client(opt.remote, create=True)
21     cli.close()
22 else:
23     git.init_repo()