Auto-generate man pages for all StGit commands
[stgit] / stgit / commands / refresh.py
index 73e4ee0..e30085b 100644 (file)
@@ -17,43 +17,39 @@ 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.out import *
 from stgit import stack, git
 from stgit.config import config
 
-
-help = 'generate a new commit for the current patch'
-usage = """%prog [options] [<files or dirs>]
-
+help = 'Generate a new commit for the current patch'
+usage = ['[options] [<files or dirs>]']
+description = """
 Include the latest tree changes in the current patch. This command
 generates a new GIT commit object with the patch details, the previous
 one no longer being visible. The '--force' option is useful
 when a commit object was created with a different tool
 but the changes need to be included in the current patch."""
 
+options = [
+    opt('-f', '--force', action = 'store_true',
+        short = 'Force the refresh even if HEAD and top differ'),
+    opt('--update', action = 'store_true',
+        short = 'Only update the current patch files'),
+    opt('--index', action = 'store_true',
+        short = 'Refresh from index instead of worktree', long = """
+        Instead of setting the patch top to the current contents of
+        the worktree, set it to the current contents of the index."""),
+    opt('--undo', action = 'store_true',
+        short = 'Revert the commit generated by the last refresh'),
+    opt('-a', '--annotate', metavar = 'NOTE',
+        short = 'Annotate the patch log entry'),
+    opt('-p', '--patch',
+        short = 'Refresh (applied) PATCH instead of the top patch')]
+
 directory = DirectoryHasRepository()
-options = [make_option('-f', '--force',
-                       help = 'force the refresh even if HEAD and '\
-                       'top differ',
-                       action = 'store_true'),
-           make_option('--update',
-                       help = 'only update the current patch files',
-                       action = 'store_true'),
-           make_option('--index',
-                       help = 'use the current contents of the index instead of looking at the working directory',
-                       action = 'store_true'),
-           make_option('--undo',
-                       help = 'revert the commit generated by the last refresh',
-                       action = 'store_true'),
-           make_option('-a', '--annotate', metavar = 'NOTE',
-                       help = 'annotate the patch log entry'),
-           make_option('-p', '--patch',
-                       help = 'refresh (applied) PATCH instead of the top one')
-           ]
 
 def func(parser, options, args):
     """Generate a new commit for the current or given patch.