3
# Copyright (C) 2013 Tim Marston <tim@edm.am>
5
# This file is part of stdhome (hereafter referred to as "this program").
6
# See http://ed.am/dev/stdhome for more information.
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
28
def print_help( self ):
29
print "Usage: " + self.program + " init [URL] [--repo=REPO]"
31
# 01234567890123456789012345678901234567890123456789012345678901234567890123456789
32
print "Initialise a local repository."
34
print "If an URL is given, the local reposity is a checkout of it (i.e., you can"
35
print "receive updates from it and changes you commit will be sent to it). The URL"
36
print "can take the form of a simple hostname, such as \"example.com\", or it can be a"
37
print "fully-qualified bazaar URL. (Actually, in the first case, where it is a simple"
38
print "hostname, it is internally expanded to scp://HOSTNAME/~/.stdhome/REPO)."
41
print " --repo select the repo to check-out or create (defaults to 'home')"
42
print " --help display help and exit"
46
def run( self, stdhome ):
49
opts, args = getopt.gnu_getopt(
52
except getopt.GetoptError as e:
53
stdhome.print_usage( e )
54
for opt, optargs in opts:
57
elif aopt == "--repo":