Ran update-copyright.
[update-copyright.git] / bin / update-copyright.py
index 9394243025e16347dcdeab9696f0c13b9b19ec9a..6fff076986e68a3c5425531c1bdc9d5657a2cc85 100755 (executable)
@@ -1,22 +1,21 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2012 W. Trevor King
+# Copyright (C) 2012 W. Trevor King <wking@tremily.us>
 #
 # This file is part of update-copyright.
 #
-# update-copyright is free software: you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# update-copyright is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# update-copyright is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
+# update-copyright is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
 #
-# You should have received a copy of the GNU General Public License
-# along with update-copyright.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# update-copyright.  If not, see <http://www.gnu.org/licenses/>.
 
 """Update copyright information with information from the VCS repository.
 
@@ -28,11 +27,12 @@ Replaces every line starting with ``^# Copyright`` and continuing with
 line between the blurb and your comment, so the next run of
 ``update_copyright.py`` doesn't clobber your comment.
 
-If no files are given, a list of files to update is generated
-automatically.
+You should configure this program via an ``.update-copyright.conf``
+file in your project root.
 """
 
 import logging as _logging
+import os.path as _os_path
 
 from update_copyright import LOG as _LOG
 from update_copyright.project import Project
@@ -42,7 +42,7 @@ if __name__ == '__main__':
     import optparse
     import sys
 
-    usage = "%%prog [options] [file ...]"
+    usage = "%prog [options] [file ...]"
 
     p = optparse.OptionParser(usage=usage, description=__doc__)
     p.add_option('--config', dest='config', default='.update-copyright.conf',
@@ -61,7 +61,7 @@ if __name__ == '__main__':
 
     _LOG.setLevel(max(_logging.DEBUG, _logging.ERROR - 10*options.verbose))
 
-    project = Project()
+    project = Project(root=_os_path.dirname(_os_path.abspath(options.config)))
     project.load_config(open(options.config, 'r'))
     if options.authors:
         project.update_authors(dry_run=options.dry_run)