changeset 254:b1776fc8e24a

Correct the help string for listpackages' --newest option and set a better default for it.
author Bernhard Herzog <bh@intevation.de>
date Tue, 14 Apr 2009 13:15:41 +0000
parents 7d932fac1055
children 70735b398bb0
files bin/listpackages.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/bin/listpackages.py	Tue Apr 14 12:45:12 2009 +0000
+++ b/bin/listpackages.py	Tue Apr 14 13:15:41 2009 +0000
@@ -16,7 +16,7 @@
 
 def parse_commandline():
     parser = create_parser()
-    parser.set_defaults(binary=False, source=False)
+    parser.set_defaults(binary=False, source=False, newest=1)
     parser.add_option("--revision",
                       help=("The revision whose files are to be listed."
                             " If not given, the latest revision is used."
@@ -31,7 +31,8 @@
     parser.add_option("--binary", action="store_true",
                       help=("List binary packages"))
     parser.add_option("--newest", type="int",
-                      help=("List binary packages"))
+                      help=("Number of newest revisions to list."
+                            " Defaults to 1."))
     return parser.parse_args()
 
 def parse_revision(raw_revision):
@@ -72,8 +73,6 @@
         candidates = [revpkg for revpkg in revisions
                       if revpkg.status.status.finished
                          and not revpkg.status.status.error]
-        if num_newest is None:
-            num_newest = 1
         candidates = candidates[:num_newest]
     else:
         for revpkg in revisions:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)