stgit.el: Use forward-line instead of goto-line non-interactively
[stgit] / stgit / commands / top.py
index c8fbba4..4ec37b4 100644 (file)
@@ -16,19 +16,23 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 """
 
-from optparse import make_option
-
+from stgit.argparse import opt
 from stgit.commands import common
 from stgit.out import out
+from stgit import argparse
 
-help = 'print the name of the top patch'
-usage = """%prog [options]
-
+help = 'Print the name of the top patch'
+kind = 'stack'
+usage = ['']
+description = """
 Print the name of the current (topmost) patch."""
 
+args = []
+options = [
+    opt('-b', '--branch', args = [argparse.stg_branches],
+        short = 'Use BRANCH instead of the default branch')]
+
 directory = common.DirectoryHasRepositoryLib()
-options = [make_option('-b', '--branch',
-                       help = 'use BRANCH instead of the default one')]
 
 def func(parser, options, args):
     """Show the name of the topmost patch