Rename "stg coalesce" to "stg squash"
[stgit] / stgit / commands / float.py
index 5af7e85..7c3dcdf 100644 (file)
@@ -17,24 +17,28 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 """
 
 import sys, os
-from optparse import OptionParser, make_option
-
+from stgit.argparse import opt
 from stgit.commands.common import *
 from stgit.utils import *
-from stgit import stack, git
-
-help = 'push patches to the top, even if applied'
-usage = """%prog [<patches> | -s [<series>] ]
+from stgit import argparse, stack, git
 
+help = 'Push patches to the top, even if applied'
+kind = 'stack'
+usage = ['<patches>',
+         '-s <series>']
+description = """
 Push a patch or a range of patches to the top even if applied. The
 necessary pop and push operations will be performed to accomplish
 this. The '--series' option can be used to rearrange the (top) patches
 as specified by the given series file (or the standard input)."""
 
-directory = DirectoryGotoToplevel()
-options = [make_option('-s', '--series',
-                       help = 'rearrange according to a series file',
-                       action = 'store_true')]
+args = [argparse.patch_range(argparse.applied_patches,
+                             argparse.unapplied_patches)]
+options = [
+    opt('-s', '--series', action = 'store_true',
+        short = 'Rearrange according to a series file')]
+
+directory = DirectoryGotoToplevel(log = True)
 
 def func(parser, options, args):
     """Pops and pushed to make the named patch the topmost patch