/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/status.py

  • Committer: Tim Marston
  • Date: 2016-02-13 13:25:21 UTC
  • Revision ID: tim@ed.am-20160213132521-46v5774k6ql7tdfn
fixed uninitialised variable

Show diffs side-by-side

added added

removed removed

30
30
 
31
31
 
32
32
        def print_help( self ):
33
 
                print "Usage: " + the.program.name + " status [--repo=REPO]"
 
33
                print "Usage: " + the.program.name + " status [--repo=REPO] [FILE]..."
34
34
                print
35
35
                #      01234567890123456789012345678901234567890123456789012345678901234567890123456789
36
36
                print "Show the state of files in the local repository (including modifications and"
61
61
                                        raise the.program.FatalError(
62
62
                                                'invalid repository name: ' + optarg )
63
63
                                the.repo = optarg
64
 
                        elif opt in [ '--verbose', '-v' ]:
65
 
                                the.verbose += 1
66
64
                        elif opt == "--help":
67
65
                                self.print_help()
68
 
                
 
66
 
69
67
                # discard first argument (the command)
70
68
                args.pop( 0 )
71
69
 
72
70
                # remaining arguments
73
 
                if len( args ):
74
 
                        raise the.program.UsageError( 'too many arguments' )
 
71
                self.files = args
75
72
 
76
73
 
77
74
        def run( self ):
79
76
                # set up repo and check it exists
80
77
                the.repo.check_dir_exists()
81
78
 
 
79
                # determine files
 
80
                files = self.expand_files( self.files )
 
81
 
82
82
                message = ''
83
83
 
84
84
                # initialise deployment and check if it's ongoing
101
101
                else:
102
102
 
103
103
                        # check status
104
 
                        walker = StatusWalker()
 
104
                        walker = StatusWalker( files if files else None )
105
105
                        walker.walk()
106
106
                        if walker.modified:
107
107
                                message += 'modified:\n  %s\n' % \