Index: svn2rss.py
===================================================================
--- svn2rss.py	(revision 20142)
+++ svn2rss.py	(working copy)
@@ -8,6 +8,7 @@
  -p | --repos-path=  svn repository to generate RSS 2.0 feed
  -u | --url=         link to appear in the rss item
  -f | --rss-file=    filename to store the rss feed
+ -m | --max-items=   maximum items to store in the rss feed
 
 Generates a RSS 2.0 file containing commit information.  Once the
 maximum number of items is reached, older elements are removed.  The
@@ -33,6 +34,7 @@
     print >> sys.stderr, "PyRSS2Gen can be downloaded from:"
     print >> sys.stderr, "http://www.dalkescientific.com/Python/PyRSS2Gen.html"
     print >> sys.stderr, ""
+    sys.exit(1)
 
 def usage(stream):
     print >> stream, __doc__
@@ -41,16 +43,19 @@
     usage(sys.stderr)
     sys.exit(2)
 try:
-    opts, args = getopt.gnu_getopt(sys.argv[1:],"hP:r:p:u:f:", [
+    opts, args = getopt.gnu_getopt(sys.argv[1:],"hP:r:p:u:f:m:", [
                                                       "help", "svn-path=",
                                                       "revision=",
                                                       "repos-path=", "url=",
-                                                      "rss-file="])
+                                                      "rss-file=",
+                                                      "max-items="])
 except getopt.GetoptError, msg:
     print >> sys.stderr, msg
     usage(sys.stderr)
     sys.exit(2)
 
+max_items  = None
+
 for opt, arg in opts:
     if opt in ("-h", "--help"):
         usage(sys.stdout)
@@ -65,15 +70,22 @@
         url = arg
     elif opt in ("-f", "--rss-file"):
         rss_file = arg
+    elif opt in ("-m", "--max-items"):
+        max_items = arg
 
 class SVN2RSS:
-    def __init__(self, svn_path, revision, repos_path, url, rss_file):
-        self.max_items = 20
+    def __init__(self, svn_path, revision, repos_path, url, rss_file, max_items):
         self.svn_path = svn_path
         self.revision = revision
         self.repos_path = repos_path
         self.url = url
         self.rss_file = rss_file
+
+        if (max_items == None):
+          self.max_items = 20
+        else:
+          self.max_items = int(max_items)
+
         self.rss_item_desc = self.make_rss_item_desc()
         self.svnlook = os.path.join(self.svn_path, "svnlook")
         (file, ext) = os.path.splitext(self.rss_file)
@@ -145,7 +157,7 @@
 
         return rss
 
-svn2rss = SVN2RSS(svn_path, commit_rev, repos_path, url, rss_file)
+svn2rss = SVN2RSS(svn_path, commit_rev, repos_path, url, rss_file, max_items)
 rss = svn2rss.rss
 svn2rss.pickle()
 rss.write_xml(open(rss_file, "w"))
