added help to 'upgrade'.
authorThomas Gerigk <tgerigk@gmx.de>
Mon, 3 Apr 2006 18:26:07 +0000 (20:26 +0200)
committerThomas Gerigk <tgerigk@gmx.de>
Mon, 3 Apr 2006 18:26:07 +0000 (20:26 +0200)
becommands/upgrade.py

index 0cbffa14979c83a3ab12deaabff39bc12de08872..16ac78e300ec139394438b441456df7878e2db3a 100644 (file)
 """Upgrade the bugs to the latest format"""
 import os.path
 import errno
-from libbe import bugdir, rcs
+from libbe import bugdir, rcs, cmdutil
 
 def execute(args):
+    options, args = get_parser().parse_args(args)
     root = bugdir.tree_root(".", old_version=True)
     for uuid in root.list_uuids():
         old_bug = OldBug(root.bugs_path, uuid)
@@ -98,5 +99,15 @@ class OldBug(object):
         else:
             rcs.set_file_contents(self.get_path(name), "%s\n" % value)
 
+def get_parser():
+    parser = cmdutil.CmdOptionParser("be upgrade")
+    return parser
+
+longhelp="""
+Upgrades be-database.
+"""
+
+def help():
+    return get_parser().help_str() + longhelp