Refactor message printing
[stgit] / stgit / commands / top.py
index 676c7ad..7cc92ca 100644 (file)
@@ -25,9 +25,12 @@ from stgit import stack, git
 
 
 help = 'print the name of the top patch'
-usage = '%prog'
+usage = """%prog [options]
 
-options = []
+Print the name of the current (topmost) patch."""
+
+options = [make_option('-b', '--branch',
+                       help = 'use BRANCH instead of the default one')]
 
 
 def func(parser, options, args):
@@ -38,6 +41,6 @@ def func(parser, options, args):
 
     name = crt_series.get_current()
     if name:
-        print name
+        out.stdout(name)
     else:
         raise CmdException, 'No patches applied'