/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/command/init.py

  • Committer: Tim Marston
  • Date: 2014-09-09 19:13:33 UTC
  • Revision ID: tim@ed.am-20140909191333-0b7hrzonxce8mgy3
attempt to allow arguments before main command by treating the first thing that
doesn't look like an option as the command

Show diffs side-by-side

added added

removed removed

57
57
                                        raise the.program.FatalError(
58
58
                                                'invalid repository name: ' + optarg )
59
59
                                the.repo = optarg
 
60
                        elif opt in [ '--verbose', '-v' ]:
 
61
                                the.verbose += 1
60
62
                        elif opt == "--help":
61
63
                                self.print_help()
62
 
 
 
64
                
63
65
                # discard first argument (the command)
64
66
                args.pop( 0 )
65
67
 
106
108
 
107
109
                                raise e
108
110
 
109
 
                        message = ''
110
 
 
111
 
                        # check for deployment conclicts
112
 
                        conflicts = deployment.get_conflicts()
113
 
                        if conflicts:
114
 
                                message += 'deployment conflicts:\n  %s' % \
115
 
                                                   '\n  '.join( conflicts )
116
 
 
117
 
                        # stop if there are conflicts
118
 
                        if message:
119
 
                                raise the.program.FatalError(
120
 
                                        'there were conflicts...\n' + message )
121
 
 
122
111
                        # perform deployment
123
 
                        deployment.copy_out()
 
112
                        try:
 
113
                                deployment.copy_out()
 
114
                        except deployment.Conflict as e:
 
115
                                raise the.program.FatalError( e.msg )
124
116
 
125
117
                else:
126
118