chpathtool: use built in %(prog)s for usage
authorMike Frysinger <vapier@gentoo.org>
Tue, 8 Oct 2013 19:39:53 +0000 (15:39 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 8 Oct 2013 19:39:53 +0000 (15:39 -0400)
bin/chpathtool.py

index 471582b9c47ffd3221eeba12a467f8428b474d7b..b8c6fd5cb7fb6c8ff50c95f8766cbcf32614fe32 100755 (executable)
@@ -142,9 +142,9 @@ def chpath_inplace_symlink(filename, st, old, new):
 
 def main(argv):
 
-       usage = '%s [options] <location> <old> <new>' % (os.path.basename(argv[0],))
+       usage = '%(prog)s [options] <location> <old> <new>'
        parser = ArgumentParser(usage=usage)
-       options, args = parser.parse_known_args(argv[1:])
+       options, args = parser.parse_known_args(argv)
 
        if len(args) != 3:
                parser.error('3 args required, got %s' % (len(args),))
@@ -186,4 +186,4 @@ def main(argv):
        return os.EX_OK
 
 if __name__ == '__main__':
-       sys.exit(main(sys.argv))
+       sys.exit(main(sys.argv[1:]))